Skip to content

Commit f8add06

Browse files
style: apply pre-commit auto-fixes (ruff)
Drops stray blank lines after import blocks (E303) and reorders local imports per isort across data_plane adapters/policy plus the data_plane test suite. Pure auto-fix output from pre-commit run --all-files; no semantic changes. Signed-off-by: Zhiyu Li <zhiyul@NVIDIA.com>
1 parent e7f6a91 commit f8add06

9 files changed

Lines changed: 7 additions & 12 deletions

File tree

nemo_rl/data_plane/adapters/transfer_queue.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
KVBatchMeta,
4141
)
4242

43-
4443
# ──────────────────────────────────────────────────────────────────────────
4544
# Lazy import of transfer_queue — keeps NeMo-RL importable without TQ
4645
# installed; failure is deferred to construction time.

nemo_rl/models/policy/tq_policy.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
from nemo_rl.utils.flops_tracker import get_theoretical_tflops
5454
from nemo_rl.utils.timer import Timer
5555

56-
5756
# ──────────────────────────────────────────────────────────────────────────
5857
# Per-stage aggregators that assemble per-rank worker results into the
5958
# shape each Policy method returns. Used by the TQ-mediated overrides

tests/data_plane/functional/test_seqpack_equivalence.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
from nemo_rl.data_plane import build_data_plane_client, materialize
4949
from nemo_rl.distributed.batched_data_dict import BatchedDataDict
5050

51-
5251
# Mirror of the seed-field set in nemo_rl/algorithms/grpo_sync.py.
5352
_DP_SEED_FIELDS = (
5453
"input_ids",

tests/data_plane/functional/test_tq_multinode.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
from __future__ import annotations
2626

27-
2827
import pytest
2928
import torch
3029
from tensordict import TensorDict

tests/data_plane/unit/test_codec_mooncake.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import pytest
2626
import torch
2727

28-
2928
# ── Module-level state restoration fixture ───────────────────────────────────
3029

3130

@@ -55,9 +54,10 @@ def test_promote_1d_unsqueezes_on_write(codec_flags) -> None:
5554
pre-unsqueeze at the wire layer so per-row shape matches the metadata shape.
5655
"""
5756
# Import the adapter's _to_wire directly so this test stays unit-level.
58-
from nemo_rl.data_plane.adapters.transfer_queue import _to_wire
5957
from tensordict import TensorDict
6058

59+
from nemo_rl.data_plane.adapters.transfer_queue import _to_wire
60+
6161
codec_flags.set_kv_promote_1d(True)
6262

6363
n = 8
@@ -106,9 +106,10 @@ def test_promote_1d_squeezes_on_read_roundtrip(codec_flags) -> None:
106106
def test_promote_1d_off_leaves_shape_unchanged(codec_flags) -> None:
107107
"""When _KV_PROMOTE_1D is False (the default), 1D tensors pass through
108108
the wire layer without modification."""
109-
from nemo_rl.data_plane.adapters.transfer_queue import _to_wire
110109
from tensordict import TensorDict
111110

111+
from nemo_rl.data_plane.adapters.transfer_queue import _to_wire
112+
112113
codec_flags.set_kv_promote_1d(False)
113114

114115
n = 5

tests/data_plane/unit/test_correctness.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@
2525
import torch
2626
from tensordict import TensorDict
2727

28-
from nemo_rl.experience.sync_rollout_actor import kv_first_write
2928
from nemo_rl.data_plane.adapters.noop import NoOpDataPlaneClient
3029
from nemo_rl.data_plane.driver_io import read_columns, write_columns
3130
from nemo_rl.data_plane.interfaces import KVBatchMeta
3231
from nemo_rl.data_plane.preshard import DP_SEED_FIELDS, shard_meta_for_dp
3332
from nemo_rl.distributed.batched_data_dict import BatchedDataDict
34-
33+
from nemo_rl.experience.sync_rollout_actor import kv_first_write
3534

3635
# ── helpers ────────────────────────────────────────────────────────────
3736

tests/data_plane/unit/test_interface_contract.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
from __future__ import annotations
2222

23-
2423
import pytest
2524
import torch
2625
from tensordict import TensorDict

tests/data_plane/unit/test_leader_broadcast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
import torch.distributed as dist
2626
import torch.multiprocessing as mp
2727

28-
from nemo_rl.distributed.batched_data_dict import BatchedDataDict
2928
from nemo_rl.data_plane.worker_mixin import _broadcast_batched_data_dict
29+
from nemo_rl.distributed.batched_data_dict import BatchedDataDict
3030

3131

3232
def _worker(rank: int, world_size: int, tmp_init_file: str, q):

tests/data_plane/unit/test_local_node_ip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
import pytest
3030

31-
3231
# ── helpers ──────────────────────────────────────────────────────────────────
3332

3433

@@ -126,6 +125,7 @@ def test_mc_tcp_bind_address_overwrites_existing(monkeypatch) -> None:
126125
must be overwritten with the local IP.
127126
"""
128127
import socket
128+
129129
from nemo_rl.data_plane.adapters.transfer_queue import _get_local_node_ip
130130

131131
local_ip = "10.65.4.100"

0 commit comments

Comments
 (0)