refactor: move HSTU build to devel stage#325
Conversation
Move fbgemm_gpu_hstu compilation from the build stage into the devel (base) stage so it is baked into the base image. Also remove the MAX_JOBS=2 constraint. Made-with: Cursor
Greptile SummaryThis PR refactors the Docker build pipeline by moving the Key changes:
Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["FROM BASE_IMAGE AS devel"] --> B["Install system deps\n(apt, pip: megatron, fbgemm, torchrec…)"]
B --> C["COPY third_party/FBGEMM\n(requires submodule init)"]
C --> D["RUN pip install fbgemm_gpu_hstu\n(HSTU baked into devel image)"]
D --> E["Push as DEVEL_IMAGE\n(base image with HSTU)"]
E --> F["FROM DEVEL_IMAGE AS build"]
F --> G["COPY . .\n(full repo incl. third_party/FBGEMM)"]
G --> H["RUN build dynamicemb"]
H --> I["RUN build commons"]
I --> J["Final application image"]
style C fill:#f9f,stroke:#333
style D fill:#f9f,stroke:#333
style E fill:#bbf,stroke:#333
|
Made-with: Cursor
…ache The broad COPY . . before the HSTU build invalidated the compilation layer on every repo change. Remove the unnecessary COPY . . and rm -rf pair from the devel stage so only changes to third_party/FBGEMM trigger an HSTU rebuild. Made-with: Cursor
Move fbgemm_gpu_hstu compilation from the build stage into the devel (base) stage so it is baked into the base image. Also remove the MAX_JOBS=2 constraint.
Made-with: Cursor
Description
Checklist