forked from NVIDIA-NeMo/RL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
632 lines (593 loc) · 27.4 KB
/
Copy pathpyproject.toml
File metadata and controls
632 lines (593 loc) · 27.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
[build-system]
requires = ["setuptools>=78.1.1", "wheel>=0.46.2"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
packages = ["nemo_rl"]
[tool.setuptools.dynamic]
version = { attr = "nemo_rl.__version__" } # any module attribute compatible with ast.literal_eval
readme = { file = "README.md", content-type = "text/markdown" }
[project]
name = "nemo-rl"
dynamic = ["version", "readme"]
description = "NeMo RL: A Scalable and Efficient Post-Training Library for Models Ranging from 1 GPU to 1000s, and from Tiny to >100B Parameters"
requires-python = ">=3.13.13,<3.14"
license = { text = "Apache 2.0" }
maintainers = [
{ name = "Yi-Fu Wu", email = "yifuw@nvidia.com" },
{ name = "Terry Kong", email = "terryk@nvidia.com" },
{ name = "Yuki Huang", email = "yukih@nvidia.com" },
{ name = "NVIDIA", email = "nemo-toolkit@nvidia.com" },
]
dependencies = [
"setuptools",
"pip", # Required for frozen environments; uv venv --seed may not reliably install pip
"ninja", # for flash-attn parallel build
"torch==2.11.0",
"triton; sys_platform == 'linux' and (platform_machine == 'x86_64' or platform_machine == 'aarch64')",
"colored==2.2.3",
"ray[default]>=2.55.1",
"wandb>=0.28.0",
"numpy",
"datasets>=4.0.0",
"rich",
"math-verify",
"accelerate>=0.26",
"tensorboard",
"omegaconf",
"torchdata",
"nvidia-ml-py",
"hydra-core",
"tiktoken",
"sentencepiece",
"blobfile",
"debugpy",
"nvtx",
"matplotlib",
"plotly",
"sympy>=1.14.0",
"pillow>=12.1.1",
"torchvision==0.26.0",
# Keep the base range broad enough while allowing backend extras to tighten as needed.
# Floor raised to 5.5.0 for Gemma 4 support.
"transformers>=5.5.0,<5.9.0",
"num2words>=0.5.14", # for SmolVLM
"timm",
"open-clip-torch>=3.2.0",
"mlflow>=3.13.0",
"nvidia-nvshmem-cu13>=3.6.5; sys_platform == 'linux' and (platform_machine == 'x86_64' or platform_machine == 'aarch64')", # for deep_ep build
"swanlab",
"pyzmq",
"decord2",
"soundfile>=0.13.1",
"nccl4py; sys_platform != 'darwin'", # for non-colocated refit
"cuda-bindings; sys_platform != 'darwin'", # for non-colocated refit
"pybase64", # for sglang refit
"nvidia-cudnn-cu13==9.20.0.48; sys_platform != 'darwin'", # for transformer-engine no build isolation
# tilelang — replacement Triton kernel mamba-ssm requires when
# Triton >= 3.4.0 on Hopper, see github.com/state-spaces/mamba#640.
# Without this, qwen3.5 / nano-v3 / moonlight megatron recipes
# crash at first gated-chunk backward with a RuntimeError pointing
# at this exact pip install. Linux x86_64 only — mamba-ssm itself
# is gated to that pair.
"tilelang; sys_platform == 'linux' and platform_machine == 'x86_64'",
# Data-plane stack — promoted to base so worker venvs (built by
# nemo_rl.utils.venvs.create_local_venv via bare `uv sync`, no extras)
# automatically include them. Removes the need for a `[data-plane]`
# extra and the corresponding plumbing in the per-worker venv builder.
"tensordict",
# Pinned to b266d39 (post-0.1.6, pre-0.1.7) for PR #77's MooncakeStore
# refactor: `clear` switched from unanchored `remove_by_regex` to
# exact-key `batch_remove`, which fixes a collateral-key-deletion bug
# that breaks DAPO + mooncake_cpu. Bump to the 0.1.7 tag when released.
"TransferQueue @ git+https://github.com/Ascend/TransferQueue.git@b266d39",
# Backs data_plane.backend="mooncake_cpu". Default backend is "simple"
# (in-process), but the mooncake_cpu path needs the `mooncake_master`
# binary that ships in this wheel at <site-packages>/mooncake/. Bundled
# with TQ rather than gated behind an extra so worker venvs (built
# without extras) can be flipped to mooncake_cpu via config alone.
# PyPI's base `mooncake-transfer-engine` is cu12-only (links
# libcudart.so.12), which breaks on cu13 containers. Upstream now also
# publishes a cu13 variant as a separate distribution name
# `mooncake-transfer-engine-cuda13` (same `mooncake/` import namespace,
# store.so linked against libcudart.so.13). Resolve from PyPI rather
# than the GitHub release URL — the wheel is byte-identical (verified
# sha256), and PyPI's CDN is far more reliable than github releases
# from compute nodes.
# Upstream publishes both x86_64 and aarch64 wheels (see uv.lock). CI's
# build-container runner is aarch64 (uv reports aarch64-unknown-linux-gnu),
# so the marker must include aarch64 — otherwise mooncake is silently
# excluded from the resolution during the Docker build.
"mooncake-transfer-engine-cuda13==0.3.10.post2 ; sys_platform == 'linux' and (platform_machine == 'x86_64' or platform_machine == 'aarch64')",
]
[project.optional-dependencies]
fsdp = [
# +cu13 wheels from GitHub match torch cu130; PyPI often resolves to +cu12 (libcudart.so.12).
# https://github.com/Dao-AILab/flash-attention/releases/tag/v2.8.1
"flash-attn @ https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.1/flash_attn-2.8.1+cu13torch2.10cxx11abiTRUE-cp313-cp313-linux_aarch64.whl ; sys_platform == 'linux' and platform_machine == 'aarch64'",
"flash-attn @ https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.1/flash_attn-2.8.1+cu13torch2.10cxx11abiTRUE-cp313-cp313-linux_x86_64.whl ; sys_platform == 'linux' and platform_machine == 'x86_64'",
"flash-attn==2.8.1 ; sys_platform != 'linux' or (platform_machine != 'aarch64' and platform_machine != 'x86_64')",
"mamba-ssm",
"causal-conv1d",
]
automodel = [
"nemo-automodel[moe]",
# Flash-attn version should be selected to satisfy both TE + vLLM requirements (xformers in particular)
# https://github.com/NVIDIA/TransformerEngine/blob/v2.3/transformer_engine/pytorch/attention/dot_product_attention/utils.py#L108
# https://github.com/facebookresearch/xformers/blob/8354497deb2c04c67fbb2e2ad911e86530da0e90/xformers/ops/fmha/flash.py#L76
"flash-attn @ https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.1/flash_attn-2.8.1+cu13torch2.10cxx11abiTRUE-cp313-cp313-linux_aarch64.whl ; sys_platform == 'linux' and platform_machine == 'aarch64'",
"flash-attn @ https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.1/flash_attn-2.8.1+cu13torch2.10cxx11abiTRUE-cp313-cp313-linux_x86_64.whl ; sys_platform == 'linux' and platform_machine == 'x86_64'",
"flash-attn==2.8.1 ; sys_platform != 'linux' or (platform_machine != 'aarch64' and platform_machine != 'x86_64')",
"transformers>=5.5.0,<5.6.0",
"mistral-common>=1.11.0",
"mamba-ssm",
"causal-conv1d",
"nv-grouped-gemm",
"transformer-engine[pytorch,core_cu13] @ git+https://github.com/NVIDIA/TransformerEngine.git@v2.14.1",
"deep_ep @ git+https://github.com/deepseek-ai/DeepEP.git@29d31c095796f3c8ece47ee9cdcc167051bbeed9 ; platform_machine == 'x86_64'",
"deep_ep @ git+https://github.com/deepseek-ai/DeepEP.git@a48493600c4886c1b297aaa78db0e1ebc2d8dd6c ; platform_machine == 'aarch64'",
]
vllm = [
"cuda-python",
"deep_gemm @ git+https://github.com/deepseek-ai/DeepGEMM.git@67fc64863d43521080bf2005e6528d0fceee9510",
# deep_ep also needs libibverbs-dev
# sudo apt-get update
# sudo apt-get install libibverbs-dev
"deep_ep @ git+https://github.com/deepseek-ai/DeepEP.git@29d31c095796f3c8ece47ee9cdcc167051bbeed9 ; platform_machine == 'x86_64'",
"deep_ep @ git+https://github.com/deepseek-ai/DeepEP.git@a48493600c4886c1b297aaa78db0e1ebc2d8dd6c ; platform_machine == 'aarch64'",
# Default wheels on GitHub are cu130. See v0.20.0 release assets:
# https://github.com/vllm-project/vllm/releases/tag/v0.20.0
"vllm @ https://github.com/vllm-project/vllm/releases/download/v0.20.0/vllm-0.20.0-cp38-abi3-manylinux_2_35_aarch64.whl ; sys_platform == 'linux' and platform_machine == 'aarch64'",
"vllm @ https://github.com/vllm-project/vllm/releases/download/v0.20.0/vllm-0.20.0-cp38-abi3-manylinux_2_35_x86_64.whl ; sys_platform == 'linux' and platform_machine == 'x86_64'",
"vllm==0.20.0 ; sys_platform != 'linux' or (platform_machine != 'aarch64' and platform_machine != 'x86_64')",
"num2words>=0.5.14",
"flashinfer-python==0.6.8.post1",
"flashinfer-cubin==0.6.8.post1",
"flashinfer-jit-cache==0.6.8.post1",
"nvidia-cutlass-dsl>=4.5.2",
]
sglang = [
"sglang==0.5.12.post1",
"sglang-kernel==0.4.2.post2", # Direct dep for explicit version control
"sglang-router", # Used by nemo_rl.models.generation.sglang.sglang_router for multi-engine routing
"kernels>=0.12.0,<0.13",
"flashinfer-python==0.6.11.post1",
"flashinfer-cubin==0.6.11.post1",
"flashinfer-jit-cache==0.6.11.post1",
"transformers==5.6.0",
]
mcore = [
# also need cudnn (https://developer.nvidia.com/cudnn-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=20.04&target_type=deb_network)
# wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.1-1_all.deb
# sudo dpkg -i cuda-keyring_1.1-1_all.deb
# sudo apt-get update
# sudo apt-get install cudnn-cuda-13
# This dependency also needs to be compatible with the spec in Megatron-Bridge/pyproject.toml.
# It is specified here since we don't directly use Megatron-Bridge/pyproject.toml, but a proxy setup.py+pyproject.toml combo
# outside to allow "optionally" installing the megatron path. It's simpler to deal with transformer-engine here in the NeMo RL pyproject.toml
"transformer-engine[pytorch,core_cu13] @ git+https://github.com/NVIDIA/TransformerEngine.git@release_v2.15",
"megatron-core",
"megatron-bridge",
# Must match Megatron-Bridge main's transformers requirement (still includes GLM 5.1 support).
"transformers>=5.8.1,<5.9.0",
"nvidia-modelopt[torch]; sys_platform != 'darwin'",
"onnxscript",
# Flash-attn version should be selected to satisfy both TE + vLLM requirements (xformers in particular)
# https://github.com/NVIDIA/TransformerEngine/blob/v2.3/transformer_engine/pytorch/attention/dot_product_attention/utils.py#L108
# https://github.com/facebookresearch/xformers/blob/8354497deb2c04c67fbb2e2ad911e86530da0e90/xformers/ops/fmha/flash.py#L76
"flash-attn @ https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.1/flash_attn-2.8.1+cu13torch2.10cxx11abiTRUE-cp313-cp313-linux_aarch64.whl ; sys_platform == 'linux' and platform_machine == 'aarch64'",
"flash-attn @ https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.1/flash_attn-2.8.1+cu13torch2.10cxx11abiTRUE-cp313-cp313-linux_x86_64.whl ; sys_platform == 'linux' and platform_machine == 'x86_64'",
"flash-attn==2.8.1 ; sys_platform != 'linux' or (platform_machine != 'aarch64' and platform_machine != 'x86_64')",
"mamba-ssm",
"causal-conv1d",
"fast-hadamard-transform",
"emerging-optimizers==0.2.0",
"deep_ep @ git+https://github.com/deepseek-ai/DeepEP.git@29d31c095796f3c8ece47ee9cdcc167051bbeed9 ; platform_machine == 'x86_64'",
"deep_ep @ git+https://github.com/deepseek-ai/DeepEP.git@a48493600c4886c1b297aaa78db0e1ebc2d8dd6c ; platform_machine == 'aarch64'",
"quart",
"hypercorn",
"orjson",
"flashinfer-python==0.6.8.post1",
"flashinfer-cubin==0.6.8.post1",
"flashinfer-jit-cache==0.6.8.post1",
"nvshmem4py-cu13>=0.2.1",
"cupy-cuda13x",
]
modelopt = ["nvidia-modelopt"]
nvrx = [
"nvidia-resiliency-ext==0.6.0",
] # for ft_launcher (fault-tolerant training launcher)
nemo_gym = ["nemo_gym"]
[dependency-groups]
# This is a default group so that we install these even with bare `uv sync`
build = [
# Build requirement for TE
"torch==2.11.0",
# Build requirement for TE
"setuptools",
"packaging",
"einops",
# Build requirement for nemo_run
"hatchling",
# Build requirement for mcore
"pybind11",
# Build requirement for flash-attn
"psutil",
]
docs = [
"sphinx",
"sphinx-autobuild", # For live doc serving while editing docs
"sphinx-autodoc2", # For documenting Python API
"sphinx-copybutton", # Adds a copy button for code blocks
"sphinx-design", # For design components in docs
"myst_parser", # For our markdown docs
"nvidia-sphinx-theme", # Our NVIDIA theme
"gitpython>=3.1.45", # To git-related information
"python-dotenv", # For environment variable management
"sphinxcontrib-mermaid", # For Mermaid diagram support
"swagger-plugin-for-sphinx", # For Swagger/OpenAPI documentation
]
dev = [
"pre-commit>=4.2.0",
"ruff==0.9.9",
"types-PyYAML",
"types-requests",
"pyrefly==0.24.2",
]
test = [
"pytest>=8.4.2",
"pytest-timeout",
"pytest-cov",
"pytest-asyncio",
"pytest-testmon",
"pytest-shard",
]
[tool.uv.sources]
megatron-core = { path = "3rdparty/Megatron-Bridge-workspace/Megatron-Bridge/3rdparty/Megatron-LM", editable = true }
nemo-automodel = { path = "3rdparty/Automodel-workspace/Automodel", editable = true }
megatron-bridge = { path = "3rdparty/Megatron-Bridge-workspace", editable = true }
nemo_gym = { workspace = true }
nemo_run = { git = "https://github.com/NVIDIA-NeMo/Run", rev = "414f0077c648fde2c71bb1186e97ccbf96d6844c" }
# torch/torchaudio/torchvision/triton all come from the torch index in order to pick up aarch64 wheels
torch = [
{ index = "pytorch-cu130", marker = "sys_platform != 'darwin'" },
{ index = "pypi", marker = "sys_platform == 'darwin'" },
]
torchvision = [
{ index = "pytorch-cu130", marker = "sys_platform != 'darwin'" },
{ index = "pypi", marker = "sys_platform == 'darwin'" },
]
torchaudio = [
{ index = "pytorch-cu130", marker = "sys_platform != 'darwin'" },
{ index = "pypi", marker = "sys_platform == 'darwin'" },
]
triton = [
{ index = "pytorch-cu130", marker = "sys_platform != 'darwin'" },
{ index = "pypi", marker = "sys_platform == 'darwin'" },
]
causal-conv1d = { git = "https://github.com/Dao-AILab/causal-conv1d", rev = "4f6ae4e26ae5fe8af9372f8d312ab25cc4595223" }
mamba-ssm = { git = "https://github.com/state-spaces/mamba.git", rev = "a14b1dff0454a3bc27d9eb31355dc01e4b2490ec" }
nv-grouped-gemm = { git = "https://github.com/fanshiqing/grouped_gemm", tag = "v1.1.4.post7" }
emerging-optimizers = { git = "https://github.com/NVIDIA-NeMo/Emerging-Optimizers.git", rev = "v0.2.0" }
fast-hadamard-transform = { git = "https://github.com/Dao-AILab/fast-hadamard-transform.git" }
nvidia-modelopt = { git = "https://github.com/NVIDIA/Model-Optimizer", rev = "c3b913b9cc1d82d5a0af9fa77b4db87829e6f158" }
nvidia-resiliency-ext = { git = "https://github.com/NVIDIA/nvidia-resiliency-ext.git", tag = "v0.6.0" }
flashinfer-jit-cache = { index = "flashinfer-cu130" }
[tool.uv.workspace]
members = [
"3rdparty/Gym-workspace/Gym",
# Research projects are also added here in order for them to share the global root level uv.lock.
# If we don't do this, the research projects do not see the global uv.lock, and may mistakenly
# install numpy>=2.0 because nemo-rl's core [dependencies] do not pin numpy, but when you inspect
# nemo-rl's uv.lock you'll see it's 1.X b/c megatron mandates 1.X in the optional dependencies, so
# globally we must choose 1.X otherwise we run into pickle issues from ray.
"research/template_project",
]
[[tool.uv.index]]
name = "pypi"
url = "https://pypi.org/simple"
explicit = true
[[tool.uv.index]]
name = "pytorch-cu130"
url = "https://download.pytorch.org/whl/cu130"
explicit = true
[[tool.uv.index]]
name = "flashinfer-cu130"
url = "https://flashinfer.ai/whl/cu130"
explicit = true
[tool.uv]
managed = true
environments = [
"python_version == '3.13' and sys_platform == 'linux' and platform_machine == 'x86_64'",
"python_version == '3.13' and sys_platform == 'linux' and platform_machine == 'aarch64'",
]
preview = true # Enable preview features like extra-build-dependencies
no-build-isolation-package = [
"transformer-engine-torch",
"transformer-engine",
"flash-attn",
"mamba-ssm",
"causal-conv1d",
"fast-hadamard-transform",
"deep_gemm",
"deep_ep",
"nv-grouped-gemm", # from mlm (added here to make sure it's built no isolation since mlm workspace uses setup.py)
]
# Always apply the build group since dependencies like TE/mcore/nemo-run require build dependencies
# and this lets us assume they are implicitly installed with a simply `uv sync`. Ideally, we'd
# avoid including these in the default dependency set, but for now it's required.
default-groups = ["dev", "build"]
# Users may use different link-modes depending on their scenario:
# --link-mode=hardlink (default on linux; may get warnings about switching to --link-mode copy if uv cache and venv on different file-systems)
# --link-mode=copy (slower but more reliable; supresses warning)
# --link-mode=symlink (fastest option when uv cache and venv on different file-system; caveat: venv is brittle since it depends on the environment/container)
link-mode = "copy"
# The TE override is needed to pin the TE version across all extras
# The opencv-python-headless override is needed because automodel pins it to 4.10.0.84, whereas vllm>=0.11.0 needs >= 4.11.0.
# Bumped to >=5.0.0 to pick up a bundled FFmpeg that addresses CVE-2025-9951, CVE-2025-1594, and CVE-2024-31582
# (all in opencv_python_headless.libs/libav*.so shipped by 4.x wheels, which bundle FFmpeg 5.1.6).
# The timm override is needed because sglang requires timm==1.0.16.
override-dependencies = [
"transformer-engine[pytorch,core_cu13] @ git+https://github.com/NVIDIA/TransformerEngine.git@release_v2.15",
"nvidia-cublas==13.5.1.27; sys_platform != 'darwin'",
"nvidia-cudnn-cu13==9.20.0.48; sys_platform != 'darwin'",
"nvidia-cudnn-frontend==1.23.0",
"nvidia-nvshmem-cu13>=3.6.5; sys_platform != 'darwin'",
"opencv-python-headless>=5.0.0",
"timm<=1.0.22",
"nvidia-modelopt[torch]>=0.44.0a0",
"torch==2.11.0",
"torchaudio==2.11.0",
# sglang has conflicting llguidance versions than vllm, so enforcing vllm's version since it's newer
"llguidance>=1.3.0,<1.4.0",
# Override setuptools range in other dependencies to address CVE GHSA-58pv-8j8x-9vj2
"setuptools>=80.10.2",
"deep_ep @ git+https://github.com/deepseek-ai/DeepEP.git@29d31c095796f3c8ece47ee9cdcc167051bbeed9 ; platform_machine == 'x86_64'",
"deep_ep @ git+https://github.com/deepseek-ai/DeepEP.git@a48493600c4886c1b297aaa78db0e1ebc2d8dd6c ; platform_machine == 'aarch64'",
# vLLM 0.20.0 imports CUTLASS CUTE during Qwen3.5 MoE profiling.
# 4.5.0 has a broken cutlass.cute import path for increment_coord.
"nvidia-cutlass-dsl[cu13]>=4.5.2",
# Relax megatron-core workspace member's opentelemetry-api ceiling (<1.34) for protobuf 6.x compat with ray
"opentelemetry-api>=1.33.1",
# Override sglang's xgrammar==0.1.32 to address CVE GHSA-7rgv-gqhr-fxg3
"xgrammar==0.1.33",
# Override dependencies to address CVEs
"mlflow>=3.13.0",
# Override langchain-core to address CVE GHSA-qh6h-p6c9-ff54 (path traversal in load_prompt)
"langchain-core>=1.2.22",
# Override outlines for Python 3.13 support
"outlines>=0.2.0",
# Upgrade pytest to 9.0.3
"pytest>=9.0.3",
"langchain>=0.3.28", # Address CVE-2025-65106
"langchain-core>=0.3.80", # Address CVE-2025-65106
# TransferQueue (data-plane extra) pins numpy<2.0.0; megatron-core needs
# numpy>=2.1.0 via onnx → ml-dtypes. Override globally so the data-plane
# extra composes with mcore/automodel without version-mirroring TQ's
# requirements.txt. Forward-compatible across TQ minor bumps.
"numpy>=2.1.0",
]
# CVE fixes
constraint-dependencies = [
"brotli>=1.2.0", # Address CVE GHSA-2qfp-q593-8484
"starlette>=0.49.1", # Address CVE GHSA-7f5h-v6xp-fcq8
"urllib3>=2.7.0", # Address CVE GHSA-38jv-5279-wg99
"aiohttp>=3.13.3", # Address CVE GHSA-mqqc-3gqh-h2x8
"pyasn1>=0.6.3", # Address CVE GHSA-jr27-m4p2-rc6r
"wheel>=0.46.2", # Address CVE GHSA-8rrh-rw8j-w5fx
"protobuf>=6.33.5", # Address CVE GHSA-7gcm-g887-7qv7
"python-multipart>=0.0.22", # Address CVE GHSA-wp53-j4wj-2cfg
"pygments>=2.20.0", # Address CVE GHSA-5239-wwwm-4pmq
"cbor2>=5.9.0", # Address CVE GHSA-3c37-wwvx-h642
"onnx>=1.21.0rc4", # Address CVE GHSA-hqmj-h5c6-369m
"cryptography>=46.0.6", # Address CVE GHSA-6w46-j5rx-g56g
"orjson>=3.11.6", # Address CVE GHSA-hx9q-6w63-j58v
"pyjwt>=2.13.0",
"dulwich>=1.2.5",
"diffusers>=0.38.0",
# 8.0.1 fixed _IncludedRouter.path crash on fastapi>=0.137 (github.com/trallnag/prometheus-fastapi-instrumentator/issues/370)
"prometheus-fastapi-instrumentator>=8.0.2",
"av>=17.1.0", # Address CVE-2026-40962 (FFmpeg 8.0.1 bundled in av.libs; 17.1.0+ ships FFmpeg 8.1.x)
]
# Workaround for https://github.com/NVIDIA/cutlass/issues/3259: libs-base
# and libs-cu13 wheels overlap and race on shared paths. libs-cu13 is a
# functional superset at 4.5.2, so drop libs-base to make installs deterministic.
exclude-dependencies = ["nvidia-cutlass-dsl-libs-base"]
conflicts = [
[
{ extra = "fsdp" },
{ extra = "sglang" },
],
[
{ extra = "automodel" },
{ extra = "sglang" },
],
[
{ extra = "mcore" },
{ extra = "sglang" },
],
[
{ extra = "vllm" },
{ extra = "sglang" },
],
[
{ extra = "automodel" },
{ extra = "fsdp" },
],
[
{ extra = "automodel" },
{ extra = "mcore" },
],
[
{ extra = "automodel" },
{ extra = "vllm" },
],
[
{ extra = "vllm" },
{ extra = "mcore" },
],
]
# Augment build dependencies for packages that need torch at build time
[tool.uv.extra-build-dependencies]
flash-attn = [{ requirement = "torch", match-runtime = true }]
# Git-sourced packages CAN use match-runtime = true if we provide dependency-metadata
deep_ep = [{ requirement = "torch", match-runtime = true }]
deep_gemm = [{ requirement = "torch", match-runtime = true }]
transformer-engine = [{ requirement = "torch", match-runtime = true }]
transformer-engine-torch = [{ requirement = "torch", match-runtime = true }]
mamba-ssm = [{ requirement = "torch", match-runtime = true }]
causal-conv1d = [{ requirement = "torch", match-runtime = true }]
fast-hadamard-transform = [{ requirement = "torch", match-runtime = true }]
nv-grouped-gemm = [{ requirement = "torch", match-runtime = true }]
# Needed when building from source
[[tool.uv.dependency-metadata]]
name = "flash-attn"
requires-dist = ["torch", "einops", "setuptools", "psutil", "ninja"]
[[tool.uv.dependency-metadata]]
name = "causal-conv1d"
# This version has to match the version in the commit/rev/tag used
version = "1.5.4"
requires-dist = ["torch", "packaging", "ninja"]
[[tool.uv.dependency-metadata]]
name = "fast-hadamard-transform"
version = "1.1.0"
requires-dist = ["torch", "packaging", "ninja"]
[[tool.uv.dependency-metadata]]
name = "mamba-ssm"
# This version has to match the version in the commit/rev/tag used
version = "2.2.6.post3"
requires-dist = ["torch", "packaging", "ninja", "causal-conv1d"]
[[tool.uv.dependency-metadata]]
name = "deep_ep"
# This version has to match the version in the commit/rev/tag used
version = "v1.2.1+29d31c0"
requires-dist = ["torch", "packaging", "ninja"]
[[tool.uv.dependency-metadata]]
name = "deep_gemm"
# This version has to match the version in the commit/rev/tag used
version = "2.5.0"
requires-dist = ["torch", "packaging", "ninja"]
[[tool.uv.dependency-metadata]]
name = "transformer-engine"
version = "2.15.0+42b8400"
requires-dist = ["torch", "pydantic", "importlib-metadata>=1.0", "packaging"]
[[tool.uv.dependency-metadata]]
name = "transformer-engine-torch"
version = "2.15.0+42b8400"
requires-dist = ["torch", "transformer-engine"]
[[tool.uv.dependency-metadata]]
name = "nv-grouped-gemm"
# This version has to match the version in the commit/rev/tag used
version = "v1.1.4.post7"
requires-dist = ["setuptools", "wheel", "torch", "numpy"]
[[tool.uv.dependency-metadata]]
name = "megatron-bridge"
# Static metadata so the root resolver handles megatron-bridge's deps
# (avoids workspace-member name-shadowing for megatron-core).
# Must stay in sync with 3rdparty/Megatron-Bridge-workspace/setup.py::CACHED_DEPENDENCIES.
version = "0.0.0"
requires-dist = [
"transformers>=5.8.1,<5.9.0",
"mistral-common>=1.10.0",
"peft>=0.18.1",
"datasets>=2.20.0",
"accelerate",
"diffusers>=0.36.0",
"peft>=0.18.0",
"einops",
"omegaconf>=2.3.0",
"tensorboard>=2.19.0",
"typing-extensions",
"rich",
"wandb>=0.25.0",
"six>=1.17.0",
"regex>=2024.11.6",
"pyyaml>=6.0.2",
"tqdm>=4.67.1",
"hydra-core>1.3,<=1.3.2",
"qwen-vl-utils",
"nvidia-resiliency-ext",
"flash-linear-attention",
"timm",
"open-clip-torch>=3.2.0",
"mlflow>=3.9.0",
"comet-ml>=3.50.0",
"torch>=2.6.0",
"flashinfer-python==0.6.8.post1",
"flashinfer-cubin==0.6.8.post1",
]
# Override logsage metadata to:
# 1. Remove numpy<=2.0.2 and pandas<=2.3.3 upper bounds
# (numpy cap conflicts with onnx>=1.21.0rc4 CVE fix via nvidia-resiliency-ext)
# 2. Bump langchain ecosystem to 1.x to address CVE GHSA-qh6h-p6c9-ff54
# (langchain-core path traversal in legacy load_prompt, fix requires >=1.2.22)
# Tracking: https://github.com/NVIDIA/nvidia-resiliency-ext/issues/301
[[tool.uv.dependency-metadata]]
name = "logsage"
version = "0.1.7"
requires-dist = [
"drain3>=0.9.11,<0.10.0",
"langchain>=1.2.0,<2.0.0",
"langchain-core>=1.2.22,<2.0.0",
"langchain-nvidia-ai-endpoints>=1.0.0,<2.0.0",
"nh3>=0.3.1,<0.4.0",
"numpy",
"pandas",
"pydantic-settings>=2.11.0,<3.0.0",
"requests>=2.32.5,<3.0.0",
]
# Override drain3 to relax cachetools==4.2.1 pin (conflicts with mlflow's cachetools>=5.0.0)
# Tracking: https://github.com/logpai/Drain3/issues/119
[[tool.uv.dependency-metadata]]
name = "drain3"
version = "0.9.11"
requires-dist = ["jsonpickle", "cachetools>=4.2.1"]
[tool.black]
line-length = 120
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.venv
| build
)/
'''
[tool.pytest.ini_options]
addopts = "--durations=100 -s -rA -x"
testpaths = ["tests"]
python_files = "test_*.py"
markers = [
"run_first: marks tests that should run before others",
"mcore: marks tests that require the mcore extra",
"hf_gated: marks tests that require HuggingFace token access for gated models",
"automodel: marks tests that require the automodel extra",
"vllm: marks tests that require the vllm extra",
"sglang: marks tests that require the sglang extra",
"nemo_gym: marks tests that require the nemo_gym extra",
]
[tool.pyrefly]
project-includes = ["**/*"]
project-excludes = ["**/*venv/**/*"]
[tool.coverage.run]
concurrency = ["thread", "multiprocessing"]
omit = ["/tmp/*"]
[tool.coverage.paths]
source = ["nemo_rl/", "/opt/nemo-rl/nemo_rl/"]
[tool.ruff.lint]
# Enable all `pydocstyle` rules, limiting to those that adhere to the
# Google convention via `convention = "google"`, below.
select = ["D", "F"]
# - On top of the Google convention, disable `D417`, which requires
# documentation for every function parameter.
# - F841: local variable assigned but never used (exluced to favor readability)
# TODO: Remove D10 once we are about to release to get all the docstrings written
ignore = ["D417", "D10", "F841"]
[tool.ruff.lint.pydocstyle]
convention = "google"
# Section to exclude errors for different file types
[tool.ruff.lint.per-file-ignores]
# Ignore all directories named `tests`.
"tests/**" = ["D"]
# Ignore all files that end in `_test.py`.
"*_test.py" = ["D"]
# Ignore F401 (import but unused) in __init__.py
"__init__.py" = ["F401"]