You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
transformers 5.16 moved tensor parallelism onto DTensor. transformers.integrations.tensor_parallel is now a back-compat shim over transformers.distributed.tensor_parallel, and the two functions nnsight/modeling/tp/fragments.py depends on — all_gather and split — no longer exist anywhere in transformers.
pyproject.toml pins "transformers" unbounded, so pip install ".[dev]" now resolves 5.16.1 and every PR against 0.8 fails in CI.
CI is currently red for every PR
Same 6 failures on unrelated branches (mine, #699 and #701 — neither touches TP):
FAILED tests/test_tensor_parallel_rules.py::TestStyleCoverage::test_no_upstream_style_is_unaccounted_for
AssertionError: transformers has parallel styles this version has no rule for:
['colwise_rep', 'rowwise_rep']. Add each to SIDES (with the sides that carry a
shard) or to UNSUPPORTED.
FAILED tests/test_tensor_parallel_rules.py::TestStyleCoverage::test_no_rule_names_a_style_that_no_longer_exists
AssertionError: rules name parallel styles transformers no longer has:
['embedding_colwise'] — probably renamed upstream.
FAILED tests/test_tensor_parallel_rules.py::TestReshardGuard::test_a_value_the_gather_skipped_is_not_split[tensor0-integer position_ids]
FAILED tests/test_tensor_parallel_rules.py::TestReshardGuard::test_a_value_the_gather_skipped_is_not_split[tensor1-a boolean mask]
FAILED tests/test_tensor_parallel_rules.py::TestReshardGuard::test_a_value_the_gather_skipped_is_not_split[tensor2-a 0-dim scalar]
FAILED tests/test_tensor_parallel_rules.py::TestReshardGuard::test_a_real_shard_still_round_trips
AttributeError: <module 'transformers.integrations.tensor_parallel'> has no attribute 'split'
6 failed, 882 passed, 8 skipped, 1 xfailed
Bisected to the transformers release, not to any nnsight change:
transformers
tests/test_tensor_parallel_rules.py
5.15.1
87 passed
5.16.1
6 failed, 81 passed
The last green run I can see on 0.8 is feat/vllm-graph-taps on 2026-08-24; 5.16 landed after that.
The failing tests understate the problem
The guard tests catch split only because TestReshardGuard monkeypatches it. The imports in fragments.py are function-local, so nothing surfaces until the code actually runs — and _gather's import is never exercised on a CPU runner:
>>> from transformers.integrations.tensor_parallel import all_gather
ImportError: cannot import name 'all_gather' from 'transformers.integrations.tensor_parallel'
>>> from transformers.integrations.tensor_parallel import split
ImportError: cannot import name 'split' from 'transformers.integrations.tensor_parallel'
So on transformers ≥5.16 a sharded trace should fail at the first fragment handoff, on hardware, with an ImportError from inside a hook. I can't confirm that end to end — no multi-GPU box here — but the imports are unambiguous.
What changed upstream
transformers/integrations/tensor_parallel.py is now:
Backward-compatibility shim for the tensor parallel API.
The canonical implementation lives in transformers.distributed.tensor_parallel.
and the canonical module exports DTensor primitives instead of collectives:
No all_gather, no split, nothing *split*- or *gather*-named besides gather_state_dict_for_save. shard_and_distribute_module is kept but raises:
shard_and_distribute_module is unavailable with the DTensor tensor-parallel loading path.
Style registry deltas:
addedcolwise_rep → a ColwiseParallel instance, rowwise_rep → a RowwiseParallel instance (the _rep variants differ in output placement)
removedembedding_colwise
colwise_rep is the one plan.py already calls out by name — "Llama4Config does exactly this: its plan is colwise_rep, which is in no list and no registry" — it is in the registry now.
Why I'm not sending a patch
The SIDES table is built on "this rank's slice, made whole by an all-gather" / "this rank's term of a sum, made whole by an all-reduce". Under DTensor those handoffs are placements (Shard/Partial/Replicate) rather than explicit collectives, so this reads like a port of modeling/tp/fragments.py rather than a rename — and fragments.py is explicit that the table's inferred entries were the ones that misled before (moe_tp_experts), and that entries were measured on Llama-3.2-3B at tp=4.
I have no multi-GPU machine, so I can't measure which side carries the shard for colwise_rep / rowwise_rep, and guessing into SIDES is exactly what the comments there warn against. Adding them to UNSUPPORTED would turn CI green while preserving today's behaviour (both are currently refused by plan.py, since a style in neither table means "cannot be split") — but that only papers over the missing all_gather/split, so it seemed better to report than to make CI green on a broken path.
Happy to do any of these if you tell me which you want:
Unblock CI only — colwise_rep/rowwise_rep → UNSUPPORTED, drop embedding_colwise, and skip TestReshardGuard when split is absent. Green CI, TP still broken on ≥5.16, no false claim of support.
Cap the dependency — transformers<5.16 in pyproject.toml plus a MAXIMUM_TRANSFORMERS guard next to the existing MINIMUM_TRANSFORMERS = "5.15.0", so users get UnsupportedTransformersVersion instead of an ImportError from inside a hook.
Summary
transformers5.16 moved tensor parallelism onto DTensor.transformers.integrations.tensor_parallelis now a back-compat shim overtransformers.distributed.tensor_parallel, and the two functionsnnsight/modeling/tp/fragments.pydepends on —all_gatherandsplit— no longer exist anywhere in transformers.pyproject.tomlpins"transformers"unbounded, sopip install ".[dev]"now resolves 5.16.1 and every PR against0.8fails in CI.CI is currently red for every PR
Same 6 failures on unrelated branches (mine, #699 and #701 — neither touches TP):
Bisected to the transformers release, not to any nnsight change:
tests/test_tensor_parallel_rules.pyThe last green run I can see on
0.8isfeat/vllm-graph-tapson 2026-08-24; 5.16 landed after that.The failing tests understate the problem
The guard tests catch
splitonly becauseTestReshardGuardmonkeypatches it. The imports infragments.pyare function-local, so nothing surfaces until the code actually runs — and_gather's import is never exercised on a CPU runner:Both now raise:
So on transformers ≥5.16 a sharded trace should fail at the first fragment handoff, on hardware, with an
ImportErrorfrom inside a hook. I can't confirm that end to end — no multi-GPU box here — but the imports are unambiguous.What changed upstream
transformers/integrations/tensor_parallel.pyis now:and the canonical module exports DTensor primitives instead of collectives:
No
all_gather, nosplit, nothing*split*- or*gather*-named besidesgather_state_dict_for_save.shard_and_distribute_moduleis kept but raises:Style registry deltas:
colwise_rep→ aColwiseParallelinstance,rowwise_rep→ aRowwiseParallelinstance (the_repvariants differ in output placement)embedding_colwisecolwise_repis the oneplan.pyalready calls out by name — "Llama4Configdoes exactly this: its plan iscolwise_rep, which is in no list and no registry" — it is in the registry now.Why I'm not sending a patch
The
SIDEStable is built on "this rank's slice, made whole by an all-gather" / "this rank's term of a sum, made whole by an all-reduce". Under DTensor those handoffs are placements (Shard/Partial/Replicate) rather than explicit collectives, so this reads like a port ofmodeling/tp/fragments.pyrather than a rename — andfragments.pyis explicit that the table's inferred entries were the ones that misled before (moe_tp_experts), and that entries were measured on Llama-3.2-3B at tp=4.I have no multi-GPU machine, so I can't measure which side carries the shard for
colwise_rep/rowwise_rep, and guessing intoSIDESis exactly what the comments there warn against. Adding them toUNSUPPORTEDwould turn CI green while preserving today's behaviour (both are currently refused byplan.py, since a style in neither table means "cannot be split") — but that only papers over the missingall_gather/split, so it seemed better to report than to make CI green on a broken path.Happy to do any of these if you tell me which you want:
colwise_rep/rowwise_rep→UNSUPPORTED, dropembedding_colwise, and skipTestReshardGuardwhensplitis absent. Green CI, TP still broken on ≥5.16, no false claim of support.transformers<5.16inpyproject.tomlplus aMAXIMUM_TRANSFORMERSguard next to the existingMINIMUM_TRANSFORMERS = "5.15.0", so users getUnsupportedTransformersVersioninstead of anImportErrorfrom inside a hook.main-line CI is red meanwhile.Environment
0.8@ 96c85fc,transformers5.16.1 (broken) vs 5.15.1 (fine),torch2.9.1, Python 3.14.3 locally / 3.12 in CI, CPU.