You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5aef730
Browse filesBrowse the repository at this point in the historyBrowse files
Execute `uv pip list` to see full list of installed packages. Packages installed in /opt/venv take precedence over pip installed packages.
31
31
32
-
See /opt/NeMo-FW/pyproject.toml for additonal uv configurations.
32
+
See `/opt/NeMo-FW/pyproject.toml` for additonal uv configurations.
33
33
34
34
---
35
35
@@ -45,38 +45,55 @@ docker run -v <local-folder-path>:<container-folder-path> <container-image>
45
45
46
46
#### 1 Overwrite existing directory
47
47
48
-
1. Define the `<container-folder-path>` to correspond to the path defined in Repository Overview. (ie. /my-path/Megatron-Bridge/:/opt/Megatron-Bridge/)
48
+
1. Define the `<container-folder-path>` to correspond to the path defined in Repository Overview. (ie. `/my-path/Megatron-Bridge/:/opt/Megatron-Bridge/`)
49
49
50
50
2.`cd /opt/NeMo-FW` and run `uv sync --no-cache-dir --all-groups --inexact`
51
51
52
52
3. Local development directory is synced to run in the container
53
53
54
54
#### 2 Mount directory to a different path
55
55
56
-
1. Modify `/opt/NeMo-FW/pyproject.toml` sections `tool.uv.sources` and `tool.uv; override-dependencies` to reflect new path. (ie. "megatron-bridge" = { path = `<container-folder-path>`, editable = true })
56
+
1. Modify `/opt/NeMo-FW/pyproject.toml` sections `tool.uv.sources` and `tool.uv; override-dependencies` to reflect new path. (ie. `"megatron-bridge" = { path = <container-folder-path>, editable = true }`)
57
57
58
58
2.`cd /opt/NeMo-FW` and run `uv sync --no-cache-dir --all-groups --inexact`
59
59
60
60
3. Local development directory is synced to run in the container
61
61
62
62
### Installing packages inside the container
63
63
64
-
Packages can be installed into the uv virtualenv (`/opt/venv/`) from two locations:
64
+
All packages share a single uv virtualenv (`/opt/venv/`). The *location* you install
65
+
from determines which resolution rules apply — use the guide below.
65
66
66
-
#### From `/opt/NeMo-FW` (default)
67
+
#### Which code needs this package?
67
68
68
-
Use this when unsure, or when the dependency is not specific to Megatron:
69
+
**Megatron-Bridge/Megatron-LM** (training, model architecture):
69
70
70
71
```bash
71
-
cd /opt/NeMo-FW
72
+
cd /opt/Megatron-Bridge
72
73
uv pip install <package>
73
74
```
74
75
75
-
#### From `/opt/Megatron-Bridge`
76
+
Examples of Megatron-Bridge managed packages are TransformerEngine, nvidia-resiliency-ext, nvidia-modelopt. For a complete list, please visit `/opt/Megatron-Bridge/pyproject.toml`. Any of these dependencies can be re-installed via this directory.
77
+
78
+
It is unsafe to install packages that are not part of Megatron-Bridge from within this directory. For changing those dependencies, please visit the next section.
76
79
77
-
Use this only for Megatron-specific dependencies:
80
+
**NeMo toolkit, Export-Deploy, Run, or Evaluator**:
78
81
79
82
```bash
80
-
cd /opt/Megatron-Bridge
83
+
cd /opt/NeMo-FW
81
84
uv pip install <package>
82
85
```
86
+
87
+
This is safe to use for general packages. This directory also prevents accidental re-install of heavy dependencies like trt-llm or vllm. MBridge-managed packages
88
+
(TransformerEngine, nvidia-resiliency-ext, nvidia-modelopt, etc.) are protected
89
+
and will not be overwritten. For reinstalling those, please visit the next section.
90
+
91
+
**vllm, tensorrt-llm, or tensorrt**:
92
+
93
+
These are built from source and baked into the container at build time (see
94
+
`docker/Dockerfile.fw_base`). They cannot be managed via `uv pip install`.
95
+
To change them, rebuild the container.
96
+
97
+
**general note:**
98
+
99
+
Running uv pip install outside any of the two directories above might lead to a re-install of torch, thus breaking all dependencies that have been compiled against the original torch version. By running uv pip install inside any of the two directories, we can avoid this unwanted side-effect.
0 commit comments