Skip to content

Getting Started

Installation

pip install openlithohub
pip install openlithohub[data]
pip install openlithohub[workflow]
pip install openlithohub[all]

From source (development)

git clone https://github.com/OpenLithoHub/OpenLithoHub.git
cd OpenLithoHub
pip install -e ".[dev]"

Your First Evaluation

Run the built-in dummy model against synthetic data:

openlithohub eval \
  --model dummy-identity \
  --dataset lithobench \
  --data-root ./data/lithobench \
  --format table

Output:

┌──────────────────┬────────────────┐
│ Metric           │ Value          │
├──────────────────┼────────────────┤
│ epe_mean_nm      │ 0.0000         │
│ epe_max_nm       │ 0.0000         │
│ mrc_violation_rate│ 0.0000        │
│ mrc_passed       │ 1.0000         │
└──────────────────┴────────────────┘

Using as a Python Library

import torch
from openlithohub.benchmark.metrics import compute_epe, compute_pvband
from openlithohub.benchmark.compliance import check_mrc, check_drc

predicted = torch.rand(1, 1, 256, 256) > 0.5
target = torch.rand(1, 1, 256, 256) > 0.5

# Edge Placement Error
epe = compute_epe(predicted.float(), target.float(), pixel_size_nm=1.0)
print(f"EPE mean: {epe['epe_mean_nm']:.2f} nm")

# Process Variation Band
pvb = compute_pvband(predicted.float(), defocus_range_nm=20.0)
print(f"PV Band: {pvb['pvband_mean_nm']:.2f} nm")

# Manufacturing compliance
mrc = check_mrc(predicted.float(), min_width_nm=40.0, min_spacing_nm=40.0)
print(f"MRC passed: {mrc.passed}")

Registering a Custom Model

import torch
from openlithohub.models.base import LithographyModel, PredictionResult
from openlithohub.models.registry import registry

@registry.register
class MyOPCModel(LithographyModel):
    @property
    def name(self) -> str:
        return "my-opc"

    @property
    def supports_curvilinear(self) -> bool:
        return True

    def predict(self, design: torch.Tensor, **kwargs) -> PredictionResult:
        # Your optimization algorithm here
        mask = design  # placeholder
        return PredictionResult(mask=mask)

Once registered, your model is available via the CLI:

openlithohub eval --model my-opc --dataset lithobench --data-root ./data

Next Steps