Skip to content

Commit dbc9f8a

Browse files
committed
Fix Megatron installer runtime integration
1 parent 25a1194 commit dbc9f8a

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/art/megatron/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ apt-get install -y libcudnn9-headers-cuda-12 ninja-build
99

1010
# Python dependencies are installed through art_megatron_install so
1111
# downstream repos can reuse the same source of truth for versions and VCS pins.
12-
uv run python -m art_megatron_install
12+
uv run --no-sync python -m art_megatron_install

src/art_megatron_install.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@
4747
"transformer-engine-torch",
4848
"megatron-core",
4949
)
50+
_BRIDGE_OVERRIDE_LINES = (
51+
"megatron-core==0.16.1\n",
52+
"transformer-engine==2.11.0\n",
53+
"quack-kernels==0.2.5\n",
54+
)
5055

5156

5257
@dataclass(frozen=True)
@@ -201,16 +206,23 @@ def install_megatron_dependencies(*, dry_run: bool = False) -> None:
201206

202207
bridge_requirement = requirements.pop("megatron-bridge", None)
203208
if bridge_requirement is not None:
209+
override_path = "/tmp/art-megatron-bridge-override.txt"
210+
if not dry_run:
211+
with open(override_path, "w", encoding="utf-8") as override_file:
212+
override_file.writelines(_BRIDGE_OVERRIDE_LINES)
204213
_run(
205214
[
206215
_uv_executable(),
207216
"pip",
208217
"install",
209-
"--no-deps",
218+
"--override",
219+
override_path,
210220
_format_requirement(bridge_requirement),
211221
],
212222
dry_run=dry_run,
213223
)
224+
if not dry_run and os.path.exists(override_path):
225+
os.remove(override_path)
214226

215227
if dry_run or _package_installed("pynvml"):
216228
_run([_uv_executable(), "pip", "uninstall", "pynvml"], dry_run=dry_run)

0 commit comments

Comments
 (0)