-
Notifications
You must be signed in to change notification settings - Fork 18
fix(customizer): reduce complexity of the tasks images used by customizer backends #684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ffc5269
fix(customizer): reduce complexity of the tasks images used by custom…
soluwalana 5f7e05c
Merge branch 'main' into solu/simplify-tasks
soluwalana 01f50e0
Update readme
soluwalana 03bacb0
>
soluwalana d780f6d
Add missing nemo-rl entry
soluwalana 656b9e2
Fix k8s
soluwalana d92bd0a
Merge branch 'main' into solu/simplify-tasks
soluwalana ed37b11
PR Review comments
soluwalana a784942
Merge branch 'main' into solu/simplify-tasks
soluwalana e029a5f
fix build issue with new models merge
soluwalana 1dcc732
Build fix
soluwalana 7b93ff1
Merge branch 'main' into solu/simplify-tasks
soluwalana 160068e
Pin torch / transformers on tasks to avoid ABI mismatch
soluwalana File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| --- | ||
| labels: | ||
| - Fine Tuning | ||
| - NeMo | ||
| --- | ||
| ## NeMo Customizer Tasks Container | ||
|
|
||
| This container image provides shared CPU task support for NeMo Platform customization workflows (automodel, unsloth, and RL). It hosts file I/O, model entity registration, model spec analysis, and the LoRA adapter sidecar. | ||
|
|
||
| ### Resources | ||
|
|
||
| [Documentation](https://docs.nvidia.com/nemo-platform) | ||
|
|
||
| ### License | ||
|
|
||
| This container is licensed under the [Apache License 2.0](https://github.com/NVIDIA-NeMo/nemo-platform/blob/main/LICENSE). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| # syntax=docker/dockerfile:1 | ||
| # nmp-customizer-tasks - shared CPU task image for customization backends. | ||
| # | ||
| # Hosts file_io / model_entity (nmp.customization_common.tasks.*), model_spec | ||
| # analysis (nmp.core.models.tasks.model_spec), and the LoRA adapter sidecar. | ||
| # Built on NGC PyTorch 26.05 + transformers/accelerate + Nemotron wheels | ||
| # (mamba-ssm, causal-conv1d) + platform glue + nmp-models. | ||
|
|
||
| ARG SMOKE_MARKER=smoke_nmp_customizer_tasks | ||
| ARG PYTORCH_BASE=nvcr.io/nvidia/pytorch:26.05-py3 | ||
|
|
||
| FROM ${PYTORCH_BASE} AS base | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY --from=ghcr.io/astral-sh/uv:0.9.14 /uv /bin/uv | ||
| ENV PATH="/bin:${PATH}" | ||
|
|
||
| ENV VIRTUAL_ENV=/opt/venv \ | ||
| UV_PROJECT_ENVIRONMENT=/opt/venv \ | ||
| UV_LINK_MODE=copy \ | ||
| UV_COMPILE_BYTECODE=1 \ | ||
| HF_HUB_ENABLE_HF_TRANSFER=1 \ | ||
| OTEL_PYTHON_EXCLUDED_URLS="health" | ||
| ENV PATH="/opt/venv/bin:/root/.local/bin:${PATH}" | ||
|
|
||
| RUN uv venv ${UV_PROJECT_ENVIRONMENT} --system-site-packages | ||
|
|
||
| FROM base AS runtime | ||
|
|
||
| ARG USERNAME=ubuntu | ||
| ARG USER_UID=1000 | ||
| ARG USER_GID=1000 | ||
|
|
||
| COPY --from=platform-workspace / /app | ||
| WORKDIR /app | ||
|
|
||
| RUN mkdir -p /home/${USERNAME}/.cache && \ | ||
| chown -R ${USER_UID}:${USER_GID} /home/${USERNAME} /app/services/core/models | ||
|
|
||
| # HF stack for model_spec + Nemotron configs. preserve_base_torch.txt blocks uv from | ||
| # pulling PyPI torch (same idea as Automodel update_pyproject_pytorch.sh / | ||
| # docker/common/uv-pytorch.toml). TRANSFORMERS_VERSION matches Automodel r0.5.0 pin. | ||
| ARG TRANSFORMERS_VERSION=5.8.1 | ||
| RUN --mount=type=cache,target=/root/.cache/uv \ | ||
| uv pip install --python ${VIRTUAL_ENV}/bin/python --no-cache \ | ||
| --overrides /app/docker/customizer/preserve_base_torch.txt \ | ||
| "transformers==${TRANSFORMERS_VERSION}" \ | ||
| "accelerate>=1.0.0" | ||
|
|
||
| # Nemotron/Mamba CUDA wheels — compiled against NGC 26.05 torch; install --no-deps | ||
| # after the HF stack so a PyPI torch never lands in the venv first. | ||
| RUN --mount=from=causal-conv1d-wheel-src,target=/tmp/causal-conv1d-wheel-src,readonly \ | ||
| --mount=from=mamba-ssm-wheel-src,target=/tmp/mamba-ssm-wheel-src,readonly \ | ||
| uv pip install --python ${VIRTUAL_ENV}/bin/python --no-cache-dir --no-deps \ | ||
| /tmp/causal-conv1d-wheel-src/wheels/cu13.2/causal_conv1d-*cp312*.whl \ | ||
| /tmp/mamba-ssm-wheel-src/wheels/cu13.2/mamba_ssm-2.3.0-cp312*.whl | ||
|
|
||
| # Platform glue — no_override_requirements.txt keeps uv from clobbering NGC torch | ||
| # or re-resolving the HF stack (same pattern as nmp-automodel-training). | ||
| RUN --mount=type=cache,target=/root/.cache/uv \ | ||
| uv pip install --python ${VIRTUAL_ENV}/bin/python --no-cache \ | ||
| --overrides /app/docker/customizer/no_override_requirements.txt \ | ||
| -e /app/sdk/python/nemo-platform \ | ||
| -e /app/packages/nemo_platform_plugin \ | ||
| -e /app/packages/nmp_common \ | ||
| -e /app/packages/nmp_customization_common \ | ||
| -e /app/services/core/models | ||
|
|
||
| ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" | ||
| ENTRYPOINT ["/opt/venv/bin/python"] | ||
| CMD ["-m", "nmp.customization_common.tasks.file_io", "--help"] | ||
|
|
||
| USER ${USER_UID}:${USER_GID} | ||
|
|
||
| FROM runtime AS smoke-test | ||
| ARG SMOKE_MARKER | ||
| USER 0 | ||
| COPY tests/smoke_gpu/ /smoke_test/ | ||
| RUN uv pip install --python ${VIRTUAL_ENV}/bin/python --no-cache --reinstall pytest && \ | ||
| ${VIRTUAL_ENV}/bin/pytest /smoke_test/ -m ${SMOKE_MARKER} -v | ||
|
|
||
| FROM runtime |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.