import-model
Import a model into MAX
Input: a Hugging Face model ID ($ARGUMENTS).
Copy references/template.md to track this port as you work through the phases. Its file references are paths from this skill's root, so they still resolve after you copy it elsewhere.
Porting a model to MAX means writing a ModuleV3 model that performs the same
computation as the model's modeling_<type>.py in Hugging Face
transformers. You then compile it with the released weights and verify that
the outputs match. ModuleV3 is MAX's model API. Layers are Module subclasses
from max.experimental.nn with a forward() over Tensor values. Ops come
from max.experimental.functional (imported as F). The pipeline builds the
module under F.lazy() and compiles it with compile(weights=...).
Single-GPU, tensor-parallel, and expert-parallel models all use ModuleV3.
Multi-GPU models shard through a DeviceMesh.