How cuhk-eda/neural-ilt works
Project type and purpose
• This is a single‐application, research‐grade, end‐to‐end machine‐learning tool (“Neural‐ILT”) for mask optimization in photolithography. It integrates PyTorch neural networks with a CUDA‐based imaging simulator to jointly optimize masks under a partial coherent imaging model.
File structure
• Top‐level scripts:
• neural_ilt.py – main on‐neural‐network ILT correction loop
• pretrain_model.py – backbone pretraining
• eval.py – mask printability evaluation
• run_litho_sim_batch.py – batch calls into lithography simulator
• Data loading:
• dataloader/refine_data_loader.py
• dataloader/train_data_loader.py
• dataset/ispd21_train_dataset.zip
• Core ML code & losses:
• neural_ilt_backbone.py, neural_ilt.py
• ilt_loss_layer.py
• utils/unet_torch.py, utils/train_utils.py, utils/ilt_utils.py, utils/utils.py
• Simulation engine:
• lithosim/
– lithosim_cuda.py (Python/CUDA Bridge)
– lithosim_kernels/ (binary focus/defocus data + .pt tensors)
• Results and stats:
• stat/variation_test_neural_ilt.xlsx
README
• Confirms it is a GPU‐accelerated PyTorch project for ILT; highlights two flows—backbone pretraining and iterative mask refinement—and a final evaluation step.
• Dependencies: Python 3.7.3, PyTorch 1.8.0, CUDA 11.x, torchvision, PIL.
Main components & interactions
a. User / CLI
• Entry point scripts (neural_ilt.py, pretrain_model.py, eval.py) accept flags and kick off pipelines.
b. Data Layer
• Raw layout/mask data in dataset/ -> fed through dataloader/ modules -> PyTorch DataLoader objects.
c. Preprocessing & Utilities
• utils/ routines for cropping, margin, EPE checking, complexity calculation.
d. Neural Network Backbone
• UNet‐style or custom nets in neural_ilt_backbone.py + utils/unet_torch.py.
e. Training & Refinement Loop
• For backbone: pretrain_model.py → DataLoader → Model → loss (cycle L2 + complexity) → optimizer → checkpoint.
• For Neural‐ILT: neural_ilt.py → DataLoader → Model output mask → ilt_loss_layer.py (L2 + complexity) + lithosim simulation call → backprop → update mask.
f. Simulation Engine
• lithosim_cuda.py orchestrates calls to precompiled binary kernels and Torch‐tensor kernels in lithosim_kernels/ → returns simulated intensity / gradients.
g. Evaluation
• eval.py calls simulation + EPE checker to report printability score.
h. Persistence & Stats
• Checkpoints & logs written to disk; stat/ holds XLS of variation tests.
Architectural patterns & principles
• Modular separation of concerns: Data / Model / Simulation / Loss / Utils / Scripts
• Pipeline pattern: sequential flow from data to final output, with clear hand‐offs.
• GPU‐accelerated compute: heavy compute in CUDA kernels wrapped by Python.
• Extensibility: utils and dataloader modules can be swapped for new datasets or network architectures.
Final advice
• Be exhaustive: break the system into as many logical subcomponents as are meaningful.
• Interplay between the neural network routines and the CUDA‐based lithography simulator.
• To show both training (pretrain) and refinement (Neural‐ILT) workflows, plus the evaluation step.