Skip to content

Commit f77ea4d

Browse files
committed
feat(dependencies): add transformer-engine as a git dependency and update metadata
- Included transformer-engine from GitHub to ensure the latest features and fixes are available. - Updated dependency metadata in both pyproject.toml and uv.lock to reflect the new source and version. - Enhanced validation in the Docker dependency script to ensure proper locking of the transformer-engine source revision. Signed-off-by: Ajay Balasa <abalasa@nvidia.com>
1 parent 09bd5c9 commit f77ea4d

3 files changed

Lines changed: 51 additions & 41 deletions

File tree

‎.github/scripts/test_docker_dependency_layers.sh‎

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,26 @@ if "$temporary_dir/revision-validator" "$revision_repo" not-a-full-sha; then
232232
exit 1
233233
fi
234234

235-
if grep -q 'transformer-engine @ git+https://github.com/NVIDIA/TransformerEngine.git@' pyproject.toml || \
236-
grep -q '^name = "transformer-engine"$' pyproject.toml; then
237-
echo "Bridge must inherit the TransformerEngine source and metadata from the selected MCore ref" >&2
235+
te_override=$(grep -Eo \
236+
'transformer-engine @ git\+https://github.com/NVIDIA/TransformerEngine\.git@[0-9a-f]{40}' \
237+
pyproject.toml || true)
238+
te_revision=${te_override##*@}
239+
if [[ ! "$te_revision" =~ ^[0-9a-f]{40}$ ]]; then
240+
echo "Bridge must pin TransformerEngine to a full source revision" >&2
241+
exit 1
242+
fi
243+
if ! grep -q '^name = "transformer-engine"$' pyproject.toml; then
244+
echo "Bridge must provide lock metadata for the pinned TransformerEngine source" >&2
245+
exit 1
246+
fi
247+
if ! grep -Fq \
248+
"source = { git = \"https://github.com/NVIDIA/TransformerEngine.git?rev=${te_revision}#${te_revision}\" }" \
249+
uv.lock; then
250+
echo "TransformerEngine must be locked to the validated source revision" >&2
251+
exit 1
252+
fi
253+
if grep -qE '^name = "transformer-engine-(cu13|torch)"$' uv.lock; then
254+
echo "TransformerEngine must be built from source instead of split binary packages" >&2
238255
exit 1
239256
fi
240257

‎pyproject.toml‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ override-dependencies = [
130130
"torch; sys_platform == 'never'",
131131
"torchvision; sys_platform == 'never'",
132132
"triton; sys_platform == 'never'",
133+
"transformer-engine @ git+https://github.com/NVIDIA/TransformerEngine.git@4329ff84bfbdaa778a33cba02a15fb0807c64689",
133134
"mlflow>=3.15.1", # To address CVE-2025-15031
134135
"cachetools>=5.0.0",
135136
"cryptography>=43.0.0,<47",
@@ -157,6 +158,25 @@ name = "flash-mla"
157158
version = "1.0.0+b7643bd"
158159
requires-dist = []
159160

161+
# transformer-engine is a git dependency marked no-build-isolation, so uv would build it
162+
# from source just to read its metadata while locking. Keep the metadata synchronized with
163+
# the pinned TE commit so lock generation stays fast while container installation still
164+
# compiles TE against the target CUDA and cuDNN runtime.
165+
[[tool.uv.dependency-metadata]]
166+
name = "transformer-engine"
167+
version = "2.17.1+4329ff84"
168+
requires-dist = [
169+
"einops",
170+
"importlib-metadata>=1.0",
171+
"nvdlfw-inspect",
172+
"onnx",
173+
"onnxscript",
174+
"packaging",
175+
"pydantic",
176+
"torch>=2.1",
177+
]
178+
provides-extras = ["core-cu13", "pytorch"]
179+
160180
[tool.uv.sources]
161181
megatron-core = { path = "3rdparty/Megatron-LM/", editable = true }
162182
nvidia-modelopt = { index = "nvidia" }
@@ -217,7 +237,6 @@ build = [
217237
"numpy",
218238
"ninja",
219239
"nvidia-mathdx",
220-
"nvidia-cudnn-frontend>=1.25.0",
221240
]
222241
# CVE-carrying WAN diffusion codecs, needed only by WAN video caching
223242
# (src/megatron/bridge/diffusion/models/wan/inference/utils.py). All three are suppressed

‎uv.lock‎

Lines changed: 11 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)