diff --git a/nemo_rl/data_plane/adapters/transfer_queue.py b/nemo_rl/data_plane/adapters/transfer_queue.py index ce293b4e269..995cfa24c37 100644 --- a/nemo_rl/data_plane/adapters/transfer_queue.py +++ b/nemo_rl/data_plane/adapters/transfer_queue.py @@ -27,8 +27,9 @@ import socket import subprocess import time +import warnings from importlib import resources -from typing import Any +from typing import Any, cast import torch import transfer_queue as tq @@ -39,6 +40,7 @@ DataPlaneConfig, KVBatchMeta, ) +from nemo_rl.data_plane.schema import PROMOTE_1D_FIELDS # ────────────────────────────────────────────────────────────────────────── # Backend init — lifted from rl-arena/arena/backends.py. @@ -171,27 +173,28 @@ def patched(*args, **kwargs): cls.options = patched # type: ignore[method-assign] return True - patched_any = False + unpatched_classes: list[str] = [] try: - from transfer_queue.storage.simple_backend import SimpleStorageUnit + from transfer_queue.storage.simple_storage import SimpleStorageUnit - patched_any |= _install(SimpleStorageUnit) + if not _install(SimpleStorageUnit): + unpatched_classes.append("SimpleStorageUnit") except ImportError: - pass + unpatched_classes.append("SimpleStorageUnit") try: from transfer_queue.controller import TransferQueueController - patched_any |= _install(TransferQueueController) + if not _install(TransferQueueController): + unpatched_classes.append("TransferQueueController") except ImportError: - pass + unpatched_classes.append("TransferQueueController") - if not patched_any: + if unpatched_classes: # Soft-fail: TQ may have moved its actor classes. The driver will # still work; multi-node TQ may need the per-node `uv sync` workaround. - import warnings - warnings.warn( - "Could not patch TQ actor classes for runtime_env injection. " + "Could not patch every TQ actor class for runtime_env injection: " + f"unpatched={unpatched_classes}. " "Multi-node TQ may fail with ModuleNotFoundError: 'transfer_queue' " "on worker nodes. Workaround: run `uv sync` inside each node's " "container before the driver runs.", @@ -322,19 +325,23 @@ def _assert_no_key_loss(src_dict: dict, new_td: TensorDict, fn: str) -> None: def _promote_1d_leaves(td: TensorDict) -> TensorDict: - """Unsqueeze 1D tensor leaves to ``(N, 1)`` — mooncake_cpu KV-path workaround. + """Promote declared scalar leaves to ``(N, 1)`` for Mooncake. - Works around TQ's ``KVStorageManager`` 1D schema/data mismatch; - :func:`_from_wire` squeezes the trailing 1 back on read. Symmetric - with `_from_wire` — callers gate on ``self._promote_1d``. - ``NonTensorStack`` / ``NonTensorData`` leaves pass through. + The authoritative field list lives in + :data:`nemo_rl.data_plane.schema.PROMOTE_1D_FIELDS`. Declared fields must + arrive as dense ``(N,)`` tensors. Any other dense 1D tensor is rejected so + it cannot silently encounter TQ v0.1.9's schema/data mismatch. + ``NonTensorStack`` and ``NonTensorData`` leaves pass through. Args: - td: ``TensorDict`` whose 1D tensor leaves should be promoted. + td: TensorDict to validate and encode for the Mooncake wire format. Returns: - ``TensorDict`` with 1D tensor leaves unsqueezed to ``(N, 1)``; - all other leaves pass through unchanged. + TensorDict with declared scalar leaves promoted to ``(N, 1)``. + + Raises: + ValueError: If a declared field is not a dense 1D tensor, or an + undeclared field is a dense 1D tensor. """ # td.keys() (top-level) includes NonTensorData / NonTensorStack leaves. # keys(include_nested=True, leaves_only=True) enumerates tensor leaves @@ -343,9 +350,23 @@ def _promote_1d_leaves(td: TensorDict) -> TensorDict: changed = False for k in td.keys(): v = td.get(k) - if isinstance(v, torch.Tensor) and not v.is_nested and v.dim() == 1: + field_name = str(k) + if field_name in PROMOTE_1D_FIELDS: + if not isinstance(v, torch.Tensor) or v.is_nested or v.dim() != 1: + shape = tuple(v.shape) if isinstance(v, torch.Tensor) else None + raise ValueError( + f"Mooncake scalar field {field_name!r} must be a dense " + f"1D tensor with shape (N,), got {type(v).__name__} " + f"with shape {shape}." + ) new_dict[str(k)] = v.unsqueeze(-1).contiguous() changed = True + elif isinstance(v, torch.Tensor) and not v.is_nested and v.dim() == 1: + raise ValueError( + f"Mooncake field {field_name!r} is a dense 1D tensor but is " + "not declared in data_plane.schema.PROMOTE_1D_FIELDS. Add " + "the field to the schema if it is a per-sample scalar." + ) else: new_dict[str(k)] = v if not changed: @@ -356,23 +377,45 @@ def _promote_1d_leaves(td: TensorDict) -> TensorDict: def _from_wire(td: TensorDict) -> TensorDict: - """Inverse of `_promote_1d_leaves`: squeeze trailing 1 back to (N,).""" + """Normalize TQ reads and invert :func:`_promote_1d_leaves` when needed. + + Both TQ v0.1.9 storage managers reconstruct every non-scalar field as a + nested tensor, including fields whose rows all have the same shape. + Densify those uniform nested tensors first so regular batched inputs retain + their dense representation. Truly ragged fields remain nested. Finally, + squeeze only singleton dimensions declared in + :data:`nemo_rl.data_plane.schema.PROMOTE_1D_FIELDS`. + """ # Same top-level iteration as `_promote_1d_leaves`: NonTensorData / # NonTensorStack leaves are only visible via td.keys(), not leaves_only. new_dict: dict[str, Any] = {} changed = False for k in td.keys(): v = td.get(k) - if ( - isinstance(v, torch.Tensor) - and not v.is_nested - and v.dim() >= 2 - and v.shape[-1] == 1 - ): - new_dict[str(k)] = v.squeeze(-1).contiguous() - changed = True + field_name = str(k) + if isinstance(v, torch.Tensor) and v.is_nested: + rows = list(v.unbind()) + if rows and all(row.shape == rows[0].shape for row in rows[1:]): + v = torch.stack(rows) + changed = True + if field_name in PROMOTE_1D_FIELDS: + if not isinstance(v, torch.Tensor) or v.is_nested: + raise ValueError( + f"Mooncake scalar field {field_name!r} could not be " + "restored as a dense tensor." + ) + if v.dim() == 1: + new_dict[field_name] = v + elif v.dim() == 2 and v.shape[-1] == 1: + new_dict[field_name] = v.squeeze(-1).contiguous() + changed = True + else: + raise ValueError( + f"Mooncake scalar field {field_name!r} must decode as " + f"(N,) or (N, 1), got shape {tuple(v.shape)}." + ) else: - new_dict[str(k)] = v + new_dict[field_name] = v if not changed: return td new_td = TensorDict(new_dict, batch_size=td.batch_size) @@ -583,9 +626,9 @@ def put_samples( return KVBatchMeta( partition_id=partition_id, task_name=None, sample_ids=[], fields=None ) - if tags is None: - tags = [{} for _ in sample_ids] - + user_tags = ( + [{} for _ in sample_ids] if tags is None else [dict(tag) for tag in tags] + ) wire_fields: TensorDict | None = None field_names: list[str] | None = None if fields is not None: @@ -594,17 +637,21 @@ def put_samples( # TDs. TQ's encoder forces ``.contiguous()`` per tensor leaf # itself, so the call here was redundant for tensors and # destructive for non-tensors. - wire_fields = fields.detach() # type: ignore[bad-assignment,missing-argument] + detached_fields = cast( + TensorDict, + fields.detach(), # type: ignore[missing-argument] + ) if self._promote_1d: - wire_fields = _promote_1d_leaves(wire_fields) # type: ignore[bad-argument-type] - field_names = list(wire_fields.keys()) + detached_fields = _promote_1d_leaves(detached_fields) + wire_fields = detached_fields + field_names = [str(key) for key in detached_fields.keys()] # TQ's wire vocabulary is `keys=` — translation point. tq.kv_batch_put( keys=list(sample_ids), partition_id=partition_id, fields=wire_fields, - tags=tags, + tags=user_tags, ) return KVBatchMeta( @@ -612,7 +659,7 @@ def put_samples( task_name=None, sample_ids=list(sample_ids), fields=field_names, - tags=[dict(t) for t in tags] if tags else None, + tags=user_tags if user_tags else None, ) def get_samples( @@ -623,15 +670,12 @@ def get_samples( ) -> TensorDict: if not sample_ids: return TensorDict({}, batch_size=(0,)) - # TQ's wire vocabulary is `keys=` — translation point. td = tq.kv_batch_get( keys=list(sample_ids), partition_id=partition_id, select_fields=select_fields, ) - if self._promote_1d: - td = _from_wire(td) - return td + return _from_wire(td) def clear_samples(self, sample_ids: list[str] | None, partition_id: str) -> None: cleared_via_none = sample_ids is None diff --git a/nemo_rl/data_plane/schema.py b/nemo_rl/data_plane/schema.py index e451fc361cc..49cf79422e7 100644 --- a/nemo_rl/data_plane/schema.py +++ b/nemo_rl/data_plane/schema.py @@ -63,6 +63,25 @@ ROUTED_EXPERTS_FIELD = "routed_experts" +# Per-sample 1D scalar fields. The TQ adapter promotes these to ``(N, 1)`` +# on write to work around TQ v0.1.9's KVStorageManager schema/data mismatch on +# the Mooncake backend, and squeezes them back to ``(N,)`` on read. This is the +# authoritative user-level schema; no per-row shape metadata is carried. +# +# Fields listed here must be dense ``(N,)`` tensors when written through the +# Mooncake adapter. Dense 1D fields not listed here are rejected on that path so +# a new field cannot silently reintroduce the upstream shape mismatch. +# +# Delete this set and the corresponding adapter transforms when upstream TQ +# fixes 1D field schema extraction. +PROMOTE_1D_FIELDS: frozenset[str] = frozenset( + { + INPUT_LENGTHS, + "total_reward", + SAMPLE_MASK, + } +) + def fields_with_optional_routed_experts( fields: Sequence[str], diff --git a/pyproject.toml b/pyproject.toml index 9958048b578..1b4244c5727 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,11 +84,10 @@ dependencies = [ # 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", + # TransferQueue v0.1.9 adds full-system checkpoint save/load APIs and + # retains the exact-key MooncakeStore clear behavior required by DAPO. + # Pin the immutable release commit rather than the mutable version tag. + "TransferQueue @ git+https://github.com/Ascend/TransferQueue.git@c51614308b68c8d7a87c9b3ef62d59e14c69bde2", # 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 /mooncake/. Bundled @@ -391,10 +390,9 @@ override-dependencies = [ "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. + # Forces numpy past tensorrt-llm's `numpy>=2.0.0,<2.4` cap (resolves to + # 2.5.x). The original driver — TransferQueue pinning `numpy<2.0.0` — is + # gone as of TQ v0.1.9; drop this override once the trtllm cap lifts. "numpy>=2.1.0", # av (PyAV) carries CVE-bundled codec libs (libx264, libx265, libopenh264, libmp3lame). # It is only needed by megatron-bridge's optional WAN diffusion path, which installs it diff --git a/tests/unit/data_plane/README.md b/tests/unit/data_plane/README.md index f37b6b5852a..9ef9f60d417 100644 --- a/tests/unit/data_plane/README.md +++ b/tests/unit/data_plane/README.md @@ -30,10 +30,14 @@ Generated audit of every test function under `tests/unit/data_plane/` with a one - `test_materialize_default_pad_value_is_zero` — No `pad_value_dict` → pad with 0. - `test_response_from_nested_extracts_response_slice` — Worker write-back: jagged (prompt+response) → response only. -## `test_codec_mooncake.py` (4 tests) - -- `test_promote_1d_leaves_unsqueezes_1d` — `_promote_1d_leaves` turns 1D `(N,)` leaves into `(N, 1)` for mooncake wire. -- `test_promote_1d_roundtrip_via_from_wire` — `_promote_1d_leaves` + `_from_wire` restores original `(N,)` shape and values. +## `test_codec_mooncake.py` + +- `test_promote_1d_leaves_unsqueezes_1d` — `_promote_1d_leaves` turns schema-declared scalar fields from `(N,)` into `(N, 1)` for the Mooncake wire. +- `test_promote_1d_roundtrip_via_from_wire` — `_promote_1d_leaves` + `_from_wire` restores the schema-declared field's original `(N,)` shape and values. +- `test_from_wire_rejects_invalid_declared_field_shape` — Corrupt or incompatible scalar wire shapes fail at the data-plane boundary. +- `test_promote_1d_leaves_rejects_undeclared_1d_field` — Unknown dense 1D Mooncake fields fail loudly instead of silently hitting TQ's shape mismatch. +- `test_put_samples_uses_schema_without_private_shape_tags` — Promotion does not add per-row adapter metadata to user tags. +- `test_get_samples_uses_static_shape_schema` — Reads restore scalar fields by the shared schema while preserving genuine `(N, 1)` columns. - `test_pack_per_token_field_truncates_sp_padding` — pack_per_token_field slices each row to its own length, dropping SP padding. - `test_pack_per_token_field_exact_fit_matches_to_nested_by_length` — At exact fit, `pack_per_token_field` matches `to_nested_by_length`. diff --git a/tests/unit/data_plane/test_codec_mooncake.py b/tests/unit/data_plane/test_codec_mooncake.py index c9b71820d74..68752b5bb58 100644 --- a/tests/unit/data_plane/test_codec_mooncake.py +++ b/tests/unit/data_plane/test_codec_mooncake.py @@ -14,7 +14,7 @@ """Unit tests for the mooncake_cpu-specific wire workarounds. Covers: - P1 — `promote_1d` round-trip: writer unsqueezes 1D → (N,1), reader squeezes back. + P1 — schema-declared 1D scalar round-trip through the Mooncake workaround. P2 — pack_per_token_field: tolerates SP padding wider than max(lengths). No Ray, no GPU, no transfer_queue required. @@ -22,6 +22,7 @@ from __future__ import annotations +import pytest import torch from nemo_rl.data_plane.codec import pack_per_token_field, to_nested_by_length @@ -44,11 +45,12 @@ def test_promote_1d_leaves_unsqueezes_1d() -> None: n = 8 t = torch.arange(n, dtype=torch.float32) - td = TensorDict({"reward": t}, batch_size=[n]) + td = TensorDict({"input_lengths": t}, batch_size=[n]) out = _promote_1d_leaves(td) - assert out["reward"].shape == (n, 1), ( - f"Expected wire shape ({n}, 1) but got {tuple(out['reward'].shape)}." + assert out["input_lengths"].shape == (n, 1), ( + "Expected input_lengths to use the Mooncake wire shape " + f"({n}, 1), got {tuple(out['input_lengths'].shape)}." ) @@ -63,14 +65,234 @@ def test_promote_1d_roundtrip_via_from_wire() -> None: n = 6 original = torch.arange(n, dtype=torch.float32) - td = TensorDict({"reward": original}, batch_size=[n]) + td = TensorDict({"input_lengths": original}, batch_size=[n]) wire = _promote_1d_leaves(td) - assert wire["reward"].shape == (n, 1) + assert wire["input_lengths"].shape == (n, 1) back = _from_wire(wire) - assert back["reward"].shape == (n,) - assert torch.equal(back["reward"], original) + assert back["input_lengths"].shape == (n,) + assert torch.equal(back["input_lengths"], original) + + +def test_from_wire_densifies_uniform_nested_rows() -> None: + """TQ v0.1.9's uniform nested reads are restored to dense tensors.""" + from tensordict import TensorDict + + from nemo_rl.data_plane.adapters.transfer_queue import _from_wire + + rows = [torch.tensor([i, i + 1], dtype=torch.float32) for i in range(4)] + wire = TensorDict( + {"input_ids": torch.nested.as_nested_tensor(rows, layout=torch.jagged)}, + batch_size=[len(rows)], + ) + + back = _from_wire(wire) + + assert not back["input_ids"].is_nested + assert back["input_ids"].shape == (len(rows), 2) + assert torch.equal(back["input_ids"], torch.stack(rows)) + + +def test_from_wire_preserves_genuine_length_one_token_column() -> None: + """Only fields promoted from ``(N,)`` are squeezed after a TQ read.""" + from tensordict import TensorDict + + from nemo_rl.data_plane.adapters.transfer_queue import _from_wire + + n = 4 + wire = TensorDict( + { + "total_reward": torch.nested.as_nested_tensor( + [torch.tensor([float(i)]) for i in range(n)], layout=torch.jagged + ), + "input_ids": torch.nested.as_nested_tensor( + [torch.tensor([i]) for i in range(n)], layout=torch.jagged + ), + }, + batch_size=[n], + ) + + back = _from_wire(wire) + + assert back["total_reward"].shape == (n,) + assert back["input_ids"].shape == (n, 1) + assert torch.equal(back["input_ids"], torch.arange(n).unsqueeze(-1)) + + +def test_from_wire_rejects_invalid_declared_field_shape() -> None: + """A corrupted scalar wire shape fails at the data-plane boundary.""" + from tensordict import TensorDict + + from nemo_rl.data_plane.adapters.transfer_queue import _from_wire + + wire = TensorDict({"input_lengths": torch.ones(3, 2)}, batch_size=[3]) + + with pytest.raises(ValueError, match=r"input_lengths.*\(N, 1\)"): + _from_wire(wire) + + +def test_promote_1d_leaves_rejects_undeclared_1d_field() -> None: + """New scalar fields must be added to the authoritative schema.""" + from tensordict import TensorDict + + from nemo_rl.data_plane.adapters.transfer_queue import _promote_1d_leaves + + fields = TensorDict({"new_scalar": torch.arange(3)}, batch_size=[3]) + + with pytest.raises(ValueError, match="not declared.*PROMOTE_1D_FIELDS"): + _promote_1d_leaves(fields) + + +def test_promote_1d_leaves_rejects_invalid_declared_field_shape() -> None: + """A schema-declared scalar cannot silently change its user-level rank.""" + from tensordict import TensorDict + + from nemo_rl.data_plane.adapters.transfer_queue import _promote_1d_leaves + + fields = TensorDict({"input_lengths": torch.ones(3, 2)}, batch_size=[3]) + + with pytest.raises(ValueError, match=r"input_lengths.*shape \(N,\)"): + _promote_1d_leaves(fields) + + +def test_put_samples_uses_schema_without_private_shape_tags(monkeypatch) -> None: + """Mooncake promotion changes tensors but not user-provided TQ tags.""" + from tensordict import TensorDict + + import nemo_rl.data_plane.adapters.transfer_queue as tq_adapter + + n = 3 + original_fields = TensorDict( + { + "input_lengths": torch.arange(n), + "input_ids": torch.arange(n).unsqueeze(-1), + }, + batch_size=[n], + ) + user_tags = [{"weight_version": 7} for _ in range(n)] + + def fake_kv_batch_put( + *, + keys: list[str], + partition_id: str, + fields: TensorDict, + tags: list[dict[str, object]], + ) -> None: + assert keys == ["a", "b", "c"] + assert partition_id == "train" + assert fields["input_lengths"].shape == (n, 1) + assert fields["input_ids"].shape == (n, 1) + assert tags == user_tags + + monkeypatch.setattr(tq_adapter.tq, "kv_batch_put", fake_kv_batch_put) + client = object.__new__(tq_adapter.TQDataPlaneClient) + client._promote_1d = True + + meta = client.put_samples( + ["a", "b", "c"], "train", fields=original_fields, tags=user_tags + ) + + assert meta.tags == user_tags + + +def test_get_samples_uses_static_shape_schema(monkeypatch) -> None: + """The Mooncake adapter restores scalar ranks without row metadata.""" + from tensordict import TensorDict + + import nemo_rl.data_plane.adapters.transfer_queue as tq_adapter + + n = 3 + original = TensorDict( + { + "total_reward": torch.arange(n, dtype=torch.float32), + "input_ids": torch.arange(n).unsqueeze(-1), + }, + batch_size=[n], + ) + wire_data = TensorDict( + { + "total_reward": torch.nested.as_nested_tensor( + [row for row in original["total_reward"].unsqueeze(-1)], + layout=torch.jagged, + ), + "input_ids": torch.nested.as_nested_tensor( + [row for row in original["input_ids"]], layout=torch.jagged + ), + }, + batch_size=[n], + ) + + def fake_kv_batch_get( + *, keys: list[str], partition_id: str, select_fields: list[str] + ) -> TensorDict: + assert keys == ["a", "b", "c"] + assert partition_id == "train" + assert select_fields == ["total_reward", "input_ids"] + return wire_data + + monkeypatch.setattr(tq_adapter.tq, "kv_batch_get", fake_kv_batch_get) + client = object.__new__(tq_adapter.TQDataPlaneClient) + client._promote_1d = True + + restored = client.get_samples( + ["a", "b", "c"], "train", ["total_reward", "input_ids"] + ) + + assert restored["total_reward"].shape == (n,) + assert restored["input_ids"].shape == (n, 1) + assert torch.equal(restored["total_reward"], original["total_reward"]) + assert torch.equal(restored["input_ids"], original["input_ids"]) + + +def test_get_samples_densifies_uniform_rows_without_1d_promotion(monkeypatch) -> None: + """The simple backend normalizes uniform nested rows without squeezing.""" + from tensordict import TensorDict + + import nemo_rl.data_plane.adapters.transfer_queue as tq_adapter + + rows = [torch.tensor([1, 2]), torch.tensor([3, 4])] + wire_data = TensorDict( + {"input_ids": torch.nested.as_nested_tensor(rows, layout=torch.jagged)}, + batch_size=[len(rows)], + ) + + def fake_kv_batch_get( + *, keys: list[str], partition_id: str, select_fields: list[str] + ) -> TensorDict: + assert keys == ["a", "b"] + assert partition_id == "train" + assert select_fields == ["input_ids"] + return wire_data + + monkeypatch.setattr(tq_adapter.tq, "kv_batch_get", fake_kv_batch_get, raising=False) + client = object.__new__(tq_adapter.TQDataPlaneClient) + client._promote_1d = False + + restored = client.get_samples(["a", "b"], "train", ["input_ids"]) + + assert not restored["input_ids"].is_nested + assert restored["input_ids"].shape == (2, 2) + assert torch.equal(restored["input_ids"], torch.stack(rows)) + + +def test_from_wire_preserves_ragged_nested_rows() -> None: + """Variable-length rollout fields must remain nested.""" + from tensordict import TensorDict + + from nemo_rl.data_plane.adapters.transfer_queue import _from_wire + + rows = [torch.arange(i + 1) for i in range(3)] + nested = torch.nested.as_nested_tensor(rows, layout=torch.jagged) + wire = TensorDict({"token_ids": nested}, batch_size=[len(rows)]) + + back = _from_wire(wire) + + assert back["token_ids"].is_nested + assert all( + torch.equal(actual, expected) + for actual, expected in zip(back["token_ids"].unbind(), rows, strict=True) + ) # ── P2: pack_per_token_field — tolerates SP padding ────────────────────────── diff --git a/tests/unit/data_plane/test_tq_lifecycle.py b/tests/unit/data_plane/test_tq_lifecycle.py index a349c27c2e7..3e79a50ff84 100644 --- a/tests/unit/data_plane/test_tq_lifecycle.py +++ b/tests/unit/data_plane/test_tq_lifecycle.py @@ -134,10 +134,11 @@ def test_smoke_round_trip_backends(tq_client_backends) -> None: consumer_tasks=["read"], ) keys = ["a", "b", "c", "d"] + values = torch.arange(12).reshape(4, 3) client.put_samples( sample_ids=keys, partition_id="smoke-backend", - fields=TensorDict({"x": torch.arange(4)}, batch_size=[4]), + fields=TensorDict({"x": values}, batch_size=[4]), ) meta = client.claim_meta( @@ -150,7 +151,9 @@ def test_smoke_round_trip_backends(tq_client_backends) -> None: assert meta.size == 4 data = client.get_data(meta) - expected = torch.tensor([keys.index(k) for k in meta.sample_ids]) + expected = torch.stack([values[keys.index(k)] for k in meta.sample_ids]) + assert not data["x"].is_nested + assert data["x"].shape == expected.shape assert torch.equal(data["x"], expected) client.clear_samples(sample_ids=None, partition_id="smoke-backend") @@ -164,11 +167,11 @@ def test_smoke_round_trip_1d_fields(tq_client_backends) -> None: this for mooncake_cpu; simple passes the tensor through unchanged. """ n = 6 - reward = torch.arange(n, dtype=torch.float32) + total_reward = torch.arange(n, dtype=torch.float32) tq_client_backends.register_partition( partition_id="smoke-1d", - fields=["reward"], + fields=["total_reward"], num_samples=n, consumer_tasks=["read"], ) @@ -176,21 +179,21 @@ def test_smoke_round_trip_1d_fields(tq_client_backends) -> None: tq_client_backends.put_samples( sample_ids=keys, partition_id="smoke-1d", - fields=TensorDict({"reward": reward}, batch_size=[n]), + fields=TensorDict({"total_reward": total_reward}, batch_size=[n]), ) meta = tq_client_backends.claim_meta( partition_id="smoke-1d", task_name="read", - required_fields=["reward"], + required_fields=["total_reward"], batch_size=n, timeout_s=30.0, ) data = tq_client_backends.get_data(meta) - assert data["reward"].shape == reward.shape, ( - f"Expected shape {tuple(reward.shape)} for 1D field, " - f"got {tuple(data['reward'].shape)}. " + assert data["total_reward"].shape == total_reward.shape, ( + f"Expected shape {tuple(total_reward.shape)} for 1D field, " + f"got {tuple(data['total_reward'].shape)}. " "TQ must not unsqueeze 1D tensors silently (R-C2)." ) diff --git a/uv.lock b/uv.lock index 940c29c2ed9..ac5225635a8 100644 --- a/uv.lock +++ b/uv.lock @@ -4467,7 +4467,7 @@ requires-dist = [ { name = "torchdata" }, { name = "torchvision", marker = "sys_platform != 'darwin'", specifier = "==0.26.0", index = "https://download.pytorch.org/whl/cu130" }, { name = "torchvision", marker = "sys_platform == 'darwin'", specifier = "==0.26.0", index = "https://pypi.org/simple" }, - { name = "transferqueue", git = "https://github.com/Ascend/TransferQueue.git?rev=b266d39" }, + { name = "transferqueue", git = "https://github.com/Ascend/TransferQueue.git?rev=c51614308b68c8d7a87c9b3ef62d59e14c69bde2" }, { name = "transformer-engine", extras = ["core-cu13", "pytorch"], marker = "extra == 'automodel'", git = "https://github.com/NVIDIA/TransformerEngine.git?rev=v2.14.1" }, { name = "transformers", specifier = ">=5.5.0,<5.9.0" }, { name = "transformers", marker = "extra == 'automodel'", specifier = ">=5.5.0,<5.6.0" }, @@ -8004,14 +8004,15 @@ wheels = [ [[package]] name = "transferqueue" -version = "0.1.7.dev0" -source = { git = "https://github.com/Ascend/TransferQueue.git?rev=b266d39#b266d39a15aae114730de36cf8317b6285436f7f" } +version = "0.1.9" +source = { git = "https://github.com/Ascend/TransferQueue.git?rev=c51614308b68c8d7a87c9b3ef62d59e14c69bde2#c51614308b68c8d7a87c9b3ef62d59e14c69bde2" } dependencies = [ { name = "hydra-core", version = "1.3.2", source = { registry = "https://pypi.org/simple" }, marker = "(platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-fsdp') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-fsdp' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-trtllm' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine == 'aarch64' and sys_platform == 'linux' and extra == 'extra-7-nemo-rl-mcore') or (platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-7-nemo-rl-mcore') or (platform_machine == 'aarch64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-fsdp') or (platform_machine == 'aarch64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore') or (platform_machine == 'aarch64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine == 'aarch64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine == 'aarch64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine == 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-fsdp') or (platform_machine == 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore') or (platform_machine == 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine == 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine == 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine == 'aarch64' and extra == 'extra-7-nemo-rl-fsdp' and extra != 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine == 'aarch64' and extra != 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine == 'aarch64' and extra != 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine == 'aarch64' and extra != 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine == 'x86_64' and extra == 'extra-7-nemo-rl-fsdp' and extra != 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine == 'x86_64' and extra != 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine == 'x86_64' and extra != 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine == 'x86_64' and extra != 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-fsdp') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-fsdp' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-trtllm' and extra == 'extra-7-nemo-rl-vllm')" }, { name = "hydra-core", version = "1.3.4", source = { registry = "https://pypi.org/simple" }, marker = "(platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-fsdp') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-fsdp' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-trtllm' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine == 'aarch64' and sys_platform == 'linux' and extra == 'extra-7-nemo-rl-automodel') or (platform_machine == 'aarch64' and sys_platform == 'linux' and extra != 'extra-7-nemo-rl-mcore') or (platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-7-nemo-rl-automodel') or (platform_machine == 'x86_64' and sys_platform == 'linux' and extra != 'extra-7-nemo-rl-mcore') or (platform_machine == 'aarch64' and extra != 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine == 'aarch64' and extra != 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine == 'aarch64' and extra != 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine == 'x86_64' and extra != 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine == 'x86_64' and extra != 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine == 'x86_64' and extra != 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-fsdp') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-fsdp' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-trtllm' and extra == 'extra-7-nemo-rl-vllm')" }, { name = "msgspec", marker = "(platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-fsdp') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-fsdp' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-trtllm' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-fsdp') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-fsdp' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-trtllm' and extra == 'extra-7-nemo-rl-vllm')" }, { name = "numpy", marker = "(platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-fsdp') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-fsdp' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-trtllm' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-fsdp') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-fsdp' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-trtllm' and extra == 'extra-7-nemo-rl-vllm')" }, { name = "omegaconf", marker = "(platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-fsdp') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-fsdp' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-trtllm' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-fsdp') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-fsdp' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-trtllm' and extra == 'extra-7-nemo-rl-vllm')" }, + { name = "prometheus-client", marker = "(platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-fsdp') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-fsdp' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-trtllm' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-fsdp') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-fsdp' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-trtllm' and extra == 'extra-7-nemo-rl-vllm')" }, { name = "psutil", marker = "(platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-fsdp') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-fsdp' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-trtllm' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-fsdp') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-fsdp' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-trtllm' and extra == 'extra-7-nemo-rl-vllm')" }, { name = "pyzmq", marker = "(platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-fsdp') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-fsdp' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-trtllm' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-fsdp') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-fsdp' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-trtllm' and extra == 'extra-7-nemo-rl-vllm')" }, { name = "ray", extra = ["default"], marker = "(platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-fsdp') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-fsdp' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-trtllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'extra-7-nemo-rl-trtllm' and extra == 'extra-7-nemo-rl-vllm') or (platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-fsdp') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-mcore') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-automodel' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-fsdp' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-sglang') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-mcore' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-trtllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-sglang' and extra == 'extra-7-nemo-rl-vllm') or (sys_platform != 'linux' and extra == 'extra-7-nemo-rl-trtllm' and extra == 'extra-7-nemo-rl-vllm')" },