AI Slop Code RIsk Monitor

pytorch/torchtitan

A PyTorch native platform for training generative AI models

21.3 Elevated pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for pytorch/torchtitan, a Python project with 5,796 GitHub stars. SynthScan examined 250,991 lines of code across 942 source files, recording 4768 pattern matches distributed across 21 syntactic categories. The legacy adjusted pattern signal is 21.3 (Elevated pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

21.3
Adjusted Signal
21.3
Raw Pattern Score
100%
Time Factor
2026-10-11
Last Push
5.8K
Stars
Python
Language
251.0K
Lines of Code
942
Files
4.8K
Pattern Hits
2026-10-12
Scan Date
0.04
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 50.8/100 · HIGH

Can maintainers explain intent, assumptions, and trade-offs? 3539 finding(s).

Hallucinated Dependency & Supply Chain Risk 12.5/100 · LOW

Are imports declared and package/API names verified? 652 finding(s).

Agent Over-Engineering Ratio 54.1/100 · HIGH

Are wrappers, guards, and repeated structures necessary? 3569 finding(s).

PR Review Velocity Impact 66.5/100 · HIGH

Which changes need focused human review? 4768 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 3HIGH 36MEDIUM 261LOW 4468

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 4768 distinct pattern matches across 21 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

Hyper-Verbose Identifiers2972 hits · 2780 pts
SeverityFileLineSnippetContext
LOW…ts/unit_tests/gpu/test_deepep_activation_checkpoint.py123 def test_dispatch_and_combine_are_saved_not_replayed(self):CODE
LOW…ts/unit_tests/gpu/test_deepep_activation_checkpoint.py137 def test_region_ac_replay_is_exact(self):CODE
LOW…ts/unit_tests/gpu/test_deepep_activation_checkpoint.py146 def _check_deepep_activation_checkpointing(CODE
LOWtests/unit_tests/gpu/test_gated_rmsnorm.py37 def test_default_forward_and_backward_emit_triton(self):CODE
LOWtests/unit_tests/gpu/test_kda_attention.py84 def test_fragments_follow_the_explicit_permutation(self):CODE
LOWtests/unit_tests/gpu/test_kda_attention.py94 def test_backend_builds_routing_from_global_varlen_metadata(self):CODE
LOWtests/unit_tests/gpu/test_kda_attention.py127 def test_metadata_annotates_cp_routing_tensors(self):CODE
LOWtests/unit_tests/gpu/test_kda_attention.py175 def test_varlen_matches_independent_documents(self):CODE
LOWtests/unit_tests/gpu/test_ema.py65 def test_construction_does_not_crash_on_dtensor_pin_memory(self):CODE
LOWtests/unit_tests/gpu/test_ema.py79 def test_step_updates_offloaded_values_correctly(self):CODE
LOWtests/unit_tests/gpu/test_ema.py104 def test_scratch_buffer_reused_across_steps(self):CODE
LOWtests/unit_tests/gpu/test_ema.py122 def test_scratch_is_bounded_well_below_parameter_memory(self):CODE
LOWtests/unit_tests/gpu/test_ema.py146 def test_compute_stream_waits_for_the_offload_read(self):CODE
LOWtests/unit_tests/gpu/test_ema.py194 def test_materialized_dtensor_is_safe_to_read_from_another_stream(self):CODE
LOWtests/unit_tests/gpu/test_ema.py220 def test_state_dict_leaves_the_container_pinned(self):CODE
LOWtests/unit_tests/gpu/test_ema.py241 def test_state_dict_failure_leaves_the_container_usable(self):CODE
LOWtests/unit_tests/gpu/test_ema.py274 def test_offload_and_plain_load_agree_on_a_partial_state_dict(self):CODE
LOWtests/unit_tests/gpu/test_ema.py296 def test_offload_state_dict_key_layout_matches_super(self):CODE
LOWtests/unit_tests/gpu/test_ema.py315 def test_save_load_round_trip_stays_offloaded(self):CODE
LOWtests/unit_tests/gpu/test_ema.py349 def test_multi_copy_round_trip_through_offload_paths(self):CODE
LOWtests/unit_tests/gpu/test_ema.py406 def _build_sharded_model_with_buffer(self) -> nn.Module:CODE
LOW⚡tests/unit_tests/gpu/test_fused_swiglu.py74 def test_replaces_only_activation(self):CODE
LOW⚡tests/unit_tests/gpu/test_fused_swiglu.py79 def test_gate_up_projection_is_linear(self):CODE
LOW⚡tests/unit_tests/gpu/test_fused_swiglu.py88 def test_preserves_converted_linear_config(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu.py102 def test_saves_native_layout_without_copy(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu.py109 def test_triton_checkpoint_loads_into_native(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu.py120 def test_native_checkpoint_loads_into_triton(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu.py138 def test_strict_load_reports_missing(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu.py162 def test_dist_gemm_config_keeps_overlap(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu.py193 def test_hf_adapter_roundtrip(self):CODE
LOWtests/unit_tests/gpu/test_cuda_graph_group_replay.py21def test_group_graph_replay_accumulates_existing_gradients() -> None:CODE
LOWtests/unit_tests/gpu/test_cuda_graph_group_replay.py60def test_group_graph_replay_accumulates_reduced_fsdp_gradients() -> None:CODE
LOWtests/unit_tests/gpu/test_cuda_graph_group_replay.py96def _run_real_fsdp_group_graph_numerics(CODE
LOWtests/unit_tests/gpu/test_cuda_graph_group_replay.py186def test_group_graph_replay_matches_real_fsdp_numerics() -> None:CODE
LOWtests/unit_tests/gpu/test_hi_mid_lo_linear.py39def test_hi_mid_lo_linear_compiles(input_dtype, weight_dtype, backward_mode):CODE
LOWtests/unit_tests/gpu/test_hi_mid_lo_linear.py135def test_compiled_backward_keeps_mid():CODE
LOWtests/unit_tests/gpu/test_hi_mid_lo_linear.py154def test_third_piece_keeps_what_two_pieces_drop(num_pieces, num_tokens, compile):CODE
LOWtests/unit_tests/gpu/test_hi_mid_lo_linear.py189def test_compiled_split_matches_eager_split(num_pieces, dim):CODE
LOWtests/unit_tests/gpu/test_hi_mid_lo_linear.py209def test_backward_compiles_the_split_once_per_pieces_and_layout():CODE
LOWtests/unit_tests/gpu/test_hi_mid_lo_linear.py244def test_backward_traces_with_make_fx(tracing_mode, out_features):CODE
LOWtests/unit_tests/gpu/test_hi_mid_lo_linear.py290def test_backward_handles_zero_tokens():CODE
LOWtests/unit_tests/gpu/test_hi_mid_lo_linear.py386def test_backward_accumulates_into_running_weight_grad(CODE
LOWtests/unit_tests/gpu/test_hi_mid_lo_linear.py443def test_inplace_wgrad_accum_raises_under_compile():CODE
LOWtests/unit_tests/gpu/test_hi_mid_lo_linear.py449def _run_fsdp_accumulates_chunk_weight_grads(rank, world_size, port):CODE
LOWtests/unit_tests/gpu/test_hi_mid_lo_linear.py510def test_fsdp_accumulates_chunk_weight_grads():CODE
LOWtests/unit_tests/gpu/test_fsdp_cpu_offload.py152 def test_vision_encoder_gets_the_same_offload_policy_as_the_decoder(self) -> None:CODE
LOWtests/unit_tests/gpu/test_fsdp_cpu_offload.py159 def test_backward_runs_with_cpu_offload_on_a_model_with_a_vision_encoder(CODE
LOWtests/unit_tests/gpu/test_fsdp_cpu_offload.py178 def test_no_offload_policy_when_cpu_offload_is_off(self) -> None:CODE
LOWtests/unit_tests/gpu/test_fsdp_cpu_offload.py189 def _run_mixed_rank_image_presence(self, *, cpu_offload: bool) -> None:CODE
LOWtests/unit_tests/gpu/test_fsdp_cpu_offload.py236 def test_mixed_rank_image_presence_completes_backward(self) -> None:CODE
LOWtests/unit_tests/gpu/test_fsdp_cpu_offload.py240 def test_mixed_rank_image_presence_completes_backward_with_cpu_offload(CODE
LOWtests/unit_tests/gpu/test_fsdp_cpu_offload.py252 def test_image_then_empty_accumulation(self) -> None:CODE
LOWtests/unit_tests/gpu/test_kimi_k3_attention_residual.py55 def test_forward_and_backward_emit_triton(self):CODE
LOWtests/unit_tests/gpu/test_kimi_k3_attention_residual.py77 def test_forward_and_backward_match_reference(self):CODE
LOWtests/unit_tests/gpu/test_kimi_k3_attention_residual.py159 def test_forward_and_backward_are_batch_invariant(self):CODE
LOWtests/unit_tests/gpu/test_nvfp4_linear.py55def _install_unsharded_weight(linear: NVFP4Linear) -> NVFP4Linear:CODE
LOWtests/unit_tests/gpu/test_remat_all_to_all.py143 def test_collective_replay_follows_region_policy(self):CODE
LOWtests/unit_tests/gpu/test_remat_all_to_all.py288 def test_torchao_padded_dispatch_matches_unpadded(self):CODE
LOWtests/unit_tests/gpu/test_mxfp8_fsdp.py63def _run_reshard_after_forward(CODE
LOWtests/unit_tests/gpu/test_mxfp8_fsdp.py274def _run_cuda_graph_cache_lifecycle(CODE
2912 more matches not shown…
Decorative Section Separators211 hits · 701 pts
SeverityFileLineSnippetContext
MEDIUM⚡tests/unit_tests/cpu/test_tp_kv_heads_validation.py117 # ------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit_tests/cpu/test_tp_kv_heads_validation.py119 # ------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit_tests/cpu/test_tp_kv_heads_validation.py127 # ------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit_tests/cpu/test_tp_kv_heads_validation.py129 # ------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit_tests/cpu/test_tp_kv_heads_validation.py137 # ------------------------------------------------------------------COMMENT
MEDIUM⚡tests/unit_tests/cpu/test_tp_kv_heads_validation.py139 # ------------------------------------------------------------------COMMENT
MEDIUM⚡…nit_tests/cpu/observability/test_structured_logging.py140# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡…nit_tests/cpu/observability/test_structured_logging.py142# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡…nit_tests/cpu/observability/test_structured_logging.py373# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡…nit_tests/cpu/observability/test_structured_logging.py375# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡…nit_tests/cpu/observability/test_structured_logging.py603# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡…nit_tests/cpu/observability/test_structured_logging.py605# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡…nit_tests/cpu/observability/test_structured_logging.py764# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡…nit_tests/cpu/observability/test_structured_logging.py766# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡…nit_tests/cpu/observability/test_structured_logging.py806# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡…nit_tests/cpu/observability/test_structured_logging.py808# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡…nit_tests/cpu/observability/test_structured_logging.py863# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡…nit_tests/cpu/observability/test_structured_logging.py865# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡…nit_tests/cpu/observability/test_structured_logging.py916# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡…nit_tests/cpu/observability/test_structured_logging.py918# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡…nit_tests/cpu/observability/test_structured_logging.py1696# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡…nit_tests/cpu/observability/test_structured_logging.py1698# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py58# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py60# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py352# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py354# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py637# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py639# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py953# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py955# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py1161# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py1163# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py1380 # ------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py1386 # ------------------------------------------------------------------COMMENT
MEDIUM⚡tests/rl/unit_tests/gpu/test_bitwise_parity.py95# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/rl/unit_tests/gpu/test_bitwise_parity.py97# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/rl/unit_tests/gpu/test_bitwise_parity.py310# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/rl/unit_tests/gpu/test_bitwise_parity.py312# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/rl/unit_tests/gpu/test_bitwise_parity.py458# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/rl/unit_tests/gpu/test_bitwise_parity.py460# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/rl/unit_tests/gpu/test_bitwise_parity.py525# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/rl/unit_tests/gpu/test_bitwise_parity.py527# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/rl/unit_tests/gpu/test_bitwise_parity.py564# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/rl/unit_tests/gpu/test_bitwise_parity.py566# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/rl/unit_tests/cpu/test_metrics.py291# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/rl/unit_tests/cpu/test_metrics.py293# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/rl/unit_tests/cpu/test_metrics.py362# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/rl/unit_tests/cpu/test_metrics.py364# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/rl/unit_tests/cpu/test_metrics.py478# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/rl/unit_tests/cpu/test_metrics.py480# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/rl/unit_tests/cpu/test_metrics.py487# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/rl/unit_tests/cpu/test_metrics.py489# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/rl/unit_tests/cpu/test_metrics.py716# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/rl/unit_tests/cpu/test_metrics.py718# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/rl/unit_tests/cpu/test_metrics.py23# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/rl/unit_tests/cpu/test_metrics.py25# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡scripts/loss_compare.py316# =============================================================================COMMENT
MEDIUM⚡scripts/loss_compare.py318# =============================================================================COMMENT
MEDIUMscripts/loss_compare.py84# =============================================================================COMMENT
MEDIUMscripts/loss_compare.py86# =============================================================================COMMENT
151 more matches not shown…
Unused Imports552 hits · 522 pts
SeverityFileLineSnippetContext
LOWtests/rl/unit_tests/cpu/test_rollout_recorder.py9CODE
LOWtests/rl/unit_tests/cpu/test_dapo_math.py9CODE
LOWtests/rl/unit_tests/cpu/test_alphabet_sort.py9CODE
LOWtests/rl/unit_tests/cpu/test_metrics.py9CODE
LOWtests/rl/unit_tests/cpu/test_metrics.py611CODE
LOWtests/rl/unit_tests/cpu/test_train_loop.py9CODE
LOWtests/rl/unit_tests/cpu/test_muse_glimmer_renderer.py20CODE
LOWtests/rl/unit_tests/cpu/test_intra_generator_router.py9CODE
LOWtests/rl/unit_tests/cpu/test_rollout_utils.py9CODE
LOWtests/rl/unit_tests/cpu/test_verifiers.py9CODE
LOWtests/rl/unit_tests/cpu/test_runtime_env.py7CODE
LOWtests/rl/unit_tests/cpu/test_engine_loop.py14CODE
LOWtests/rl/unit_tests/cpu/test_verifiers_example.py9CODE
LOW…checkpoint_conversion/numerical_tests_qwen3_5_shard.py29CODE
LOWtorchtitan_recipes/overrides/helion_rope.py35CODE
LOWtorchtitan_recipes/overrides/moe_token_dispatcher.py40CODE
LOWtorchtitan_recipes/rl/verifiers_dapo_math.py9CODE
LOWtorchtitan_recipes/rl/dapo_math.py9CODE
LOWtorchtitan_recipes/rl/search_r1.py17CODE
LOWtorchtitan/training_engine.py54CODE
LOWtorchtitan/tools/filesystem.py15CODE
LOWtorchtitan/distributed/spmd_types.py9CODE
LOWtorchtitan/distributed/fsdp.py42CODE
LOWtorchtitan/distributed/fsdp.py43CODE
LOWtorchtitan/distributed/__init__.py7CODE
LOWtorchtitan/distributed/__init__.py8CODE
LOWtorchtitan/distributed/__init__.py8CODE
LOWtorchtitan/distributed/utils.py7CODE
LOWtorchtitan/distributed/context_parallel.py9CODE
LOWtorchtitan/distributed/parallelism_context.py13CODE
LOW…n/distributed/flex_shard/_optimizer_reshard_runtime.py16CODE
LOWtorchtitan/distributed/flex_shard/dist_muon.py9CODE
LOWtorchtitan/distributed/flex_shard/__init__.py9CODE
LOWtorchtitan/distributed/flex_shard/__init__.py10CODE
LOWtorchtitan/distributed/flex_shard/__init__.py10CODE
LOWtorchtitan/distributed/flex_shard/__init__.py10CODE
LOWtorchtitan/distributed/flex_shard/__init__.py10CODE
LOW…/distributed/flex_shard/_optimizer_reshard_schedule.py9CODE
LOWtorchtitan/distributed/flex_shard/optimizer_reshard.py9CODE
LOWtorchtitan/config/__init__.py15CODE
LOWtorchtitan/config/__init__.py15CODE
LOWtorchtitan/config/__init__.py15CODE
LOWtorchtitan/config/__init__.py16CODE
LOWtorchtitan/config/__init__.py17CODE
LOWtorchtitan/config/__init__.py18CODE
LOWtorchtitan/config/__init__.py19CODE
LOWtorchtitan/config/__init__.py19CODE
LOWtorchtitan/config/__init__.py19CODE
LOWtorchtitan/config/__init__.py19CODE
LOWtorchtitan/config/__init__.py19CODE
LOWtorchtitan/config/__init__.py19CODE
LOWtorchtitan/config/__init__.py27CODE
LOWtorchtitan/config/__init__.py27CODE
LOWtorchtitan/config/loader.py9CODE
LOWtorchtitan/config/override.py32CODE
LOWtorchtitan/config/validation.py9CODE
LOWtorchtitan/config/validation.py22CODE
LOWtorchtitan/config/transform/dist_moe.py9CODE
LOWtorchtitan/config/transform/__init__.py9CODE
LOWtorchtitan/config/transform/__init__.py9CODE
492 more matches not shown…
Modern Structural Boilerplate295 hits · 296 pts
SeverityFileLineSnippetContext
LOW⚡tests/unit_tests/cpu/test_fsdp.py30 def set_force_sum_reduction_for_comms(self, enable: bool) -> None:CODE
LOW⚡tests/unit_tests/cpu/test_fsdp.py33 def set_symm_mem_for_comm(self) -> None:CODE
LOW⚡tests/unit_tests/cpu/test_trainer.py1241 def set_requires_all_reduce(self, flag: bool, *, recurse: bool = True) -> None:STRING
LOW⚡tests/unit_tests/cpu/test_trainer.py1245 def set_is_last_backward(self, flag: bool) -> None:STRING
LOW⚡tests/unit_tests/cpu/test_trainer.py1248 def set_reshard_after_backward(self, flag: bool) -> None:STRING
LOW⚡tests/unit_tests/cpu/test_trainer.py1251 def set_requires_gradient_sync(self, flag: bool, *, recurse: bool = True) -> None:STRING
LOWtests/integration_tests/run_tests.py33logger = logging.getLogger(__name__)CODE
LOWtests/integration_tests/__init__.py14__all__ = [CODE
LOWtests/integration_tests/flux.py23logger = logging.getLogger(__name__)CODE
LOW⚡tests/rl/unit_tests/gpu/test_bitwise_parity.py89logger = logging.getLogger(__name__)CODE
LOWtests/rl/unit_tests/gpu/test_bitwise_parity.py178def _set_generator_determinism(debug) -> None:CODE
LOW…s/rl/unit_tests/cpu/test_vllm_dist_moe_padding_mask.py51 def set_num_local_input_tokens_per_call(self, num_tokens: int) -> None:CODE
LOW…s/rl/unit_tests/cpu/test_vllm_dist_moe_padding_mask.py152 def set_num_valid_tokens(self, n: int) -> None:CODE
LOWtests/rl/integration_tests/rl.py48logger = logging.getLogger(__name__)CODE
LOW…skills/numerics_debugging/scripts/activation_tracer.py61logger = logging.getLogger(__name__)CODE
LOW⚡…skills/numerics_debugging/scripts/activation_tracer.py381def set_numerics_capture_active(active: bool) -> None:CODE
LOW…skills/numerics_debugging/scripts/activation_tracer.py877 def _setup(self) -> None:CODE
LOW…ripts/checkpoint_conversion/numerical_tests_example.py19logger = logging.getLogger(__name__)CODE
LOWscripts/checkpoint_conversion/convert_ema_to_hf.py30logger = logging.getLogger(__name__)CODE
LOWtorchtitan_recipes/overrides/fused_mla.py86__all__ = [CODE
LOWtorchtitan_recipes/overrides/kimi_attention_residual.py41__all__ = [CODE
LOWtorchtitan_recipes/overrides/helion_rope.py51logger = logging.getLogger(__name__)CODE
LOWtorchtitan_recipes/overrides/helion_rope.py71__all__ = ["HelionComplexRoPE"]CODE
LOWtorchtitan_recipes/overrides/fused_swiglu.py30__all__ = [CODE
LOWtorchtitan_recipes/tests/__init__.py20def _set_spmd_typechecking(config: Trainer.Config, *, typechecking: bool) -> None:CODE
LOWtorchtitan_recipes/tests/suites/features.py58logger = logging.getLogger(__name__)CODE
LOWtorchtitan_recipes/tests/models/multimodal.py66def set_rank_conditional_image_presence(config: Trainer.Config) -> None:CODE
LOWtorchtitan/training_engine.py57logger = logging.getLogger(__name__)CODE
LOWtorchtitan/train.py19logger = logging.getLogger(__name__)CODE
LOWtorchtitan/trainer.py37logger = logging.getLogger(__name__)CODE
LOWtorchtitan/tools/utils.py19logger = logging.getLogger(__name__)CODE
LOWtorchtitan/tools/garbage_collector.py18logger = logging.getLogger(__name__)CODE
LOWtorchtitan/distributed/spmd_types.py27__all__ = [CODE
LOWtorchtitan/distributed/fsdp.py27__all__ = [CODE
LOWtorchtitan/distributed/fsdp.py38logger = logging.getLogger(__name__)CODE
LOWtorchtitan/distributed/cuda_graph.py23logger = logging.getLogger(__name__)CODE
LOWtorchtitan/distributed/offloading.py9logger = logging.getLogger(__name__)CODE
LOWtorchtitan/distributed/activation_checkpoint.py23logger = logging.getLogger(__name__)CODE
LOWtorchtitan/distributed/__init__.py13__all__ = [CODE
LOWtorchtitan/distributed/local_compile.py83__all__ = ["apply_local_compile", "local_compile"]CODE
LOWtorchtitan/distributed/utils.py30logger = logging.getLogger(__name__)CODE
LOWtorchtitan/distributed/batch_invariant.py13logger = logging.getLogger(__name__)CODE
LOWtorchtitan/distributed/batch_invariant.py73def set_batch_invariance(enable: bool) -> None:CODE
LOWtorchtitan/distributed/context_parallel.py39__all__ = [CODE
LOWtorchtitan/distributed/pipeline_parallel.py41logger = logging.getLogger(__name__)CODE
LOWtorchtitan/distributed/pipeline_parallel.py44__all__ = [CODE
LOWtorchtitan/distributed/parallelism_context.py34logger = logging.getLogger(__name__)CODE
LOWtorchtitan/distributed/parallelism_context.py37__all__ = [CODE
LOWtorchtitan/distributed/flex_shard/dist_muon.py55__all__ = [CODE
LOWtorchtitan/distributed/flex_shard/__init__.py12__all__ = [CODE
LOWtorchtitan/distributed/flex_shard/optimizer_reshard.py18__all__ = ["BlockShard", "BucketConfig", "ComputeLayout", "Owned"]CODE
LOWtorchtitan/distributed/deepep/hybridep.py30logger = logging.getLogger(__name__)CODE
LOW⚡torchtitan/distributed/deepep/hybridep.py584__all__ = [CODE
LOWtorchtitan/config/configurable.py15logger = logging.getLogger(__name__)CODE
LOWtorchtitan/config/__init__.py29__all__ = [CODE
LOWtorchtitan/config/loader.py23logger = logging.getLogger(__name__)CODE
LOWtorchtitan/config/loader.py179 def _set_attr(config: object, name: str, value: Any) -> None:CODE
LOWtorchtitan/config/override.py42logger = logging.getLogger(__name__)CODE
LOWtorchtitan/config/validation.py24__all__ = [CODE
LOWtorchtitan/config/transform/dist_moe.py27__all__ = ["DistMoeTransform"]CODE
235 more matches not shown…
Deep Nesting188 hits · 169 pts
SeverityFileLineSnippetContext
LOW…ts/unit_tests/gpu/test_deepep_activation_checkpoint.py146CODE
LOWtests/unit_tests/gpu/test_ema.py349CODE
LOWtests/unit_tests/gpu/test_remat.py866CODE
LOWtests/unit_tests/gpu/test_remat.py947CODE
LOW…ts/unit_tests/gpu/test_tensor_parallel_feed_forward.py40CODE
LOWtests/unit_tests/gpu/test_fsdp_moe_sharding.py207CODE
LOWtests/unit_tests/gpu/test_fsdp_embedding.py39CODE
LOWtests/unit_tests/cpu/test_ema.py267CODE
LOWtests/unit_tests/cpu/test_state_dict_adapter.py255CODE
LOWtests/unit_tests/cpu/test_state_dict_adapter.py310CODE
LOWtests/unit_tests/cpu/test_tokenizer.py118CODE
LOWtests/unit_tests/cpu/test_tokenizer.py474CODE
LOWtests/unit_tests/cpu/test_tokenizer.py496CODE
LOWtests/unit_tests/cpu/test_tokenizer.py519CODE
LOWtests/unit_tests/cpu/test_dataset_checkpointing.py35CODE
LOWtests/unit_tests/cpu/test_convert_ema_to_hf.py135CODE
LOWtests/unit_tests/cpu/test_convert_ema_to_hf.py167CODE
LOWtests/unit_tests/cpu/test_kimi_k3_pp_block_grads.py223CODE
LOWtests/unit_tests/cpu/test_kimi_k3_pp_block_grads.py248CODE
LOWtests/unit_tests/cpu/test_deepseek_v4_dsa.py97CODE
LOWtests/unit_tests/cpu/test_embedding.py224CODE
LOWtests/unit_tests/cpu/test_validator_frequency.py13CODE
LOWtests/unit_tests/cpu/test_loss.py421CODE
LOWtests/unit_tests/cpu/test_loss.py546CODE
LOWtests/unit_tests/cpu/test_linear.py392CODE
LOWtests/unit_tests/cpu/test_linear.py426CODE
LOWtests/unit_tests/cpu/observability/test_sdc_replayer.py162CODE
LOWtests/unit_tests/cpu/observability/test_sdc_replayer.py171CODE
LOWtests/integration_tests/run_tests.py139CODE
LOWtests/integration_tests/run_tests.py380CODE
LOWtests/assets/cc12m_test/pack_test_dataset.py13CODE
LOWtests/rl/unit_tests/gpu/test_gdn_cudagraph.py152CODE
LOWtests/rl/unit_tests/gpu/test_gdn_cudagraph.py266CODE
LOWtests/rl/unit_tests/cpu/test_batcher.py181CODE
LOW…h_trace_compaction/scripts/compact_cuda_graph_trace.py693CODE
LOW…h_trace_compaction/scripts/compact_cuda_graph_trace.py743CODE
LOW…skills/numerics_debugging/scripts/activation_tracer.py428CODE
LOW…skills/numerics_debugging/scripts/activation_tracer.py459CODE
LOW…/skills/numerics_debugging/scripts/compare_numerics.py82CODE
LOW…/skills/numerics_debugging/scripts/compare_numerics.py341CODE
LOW…/skills/numerics_debugging/scripts/compare_numerics.py489CODE
LOW…/skills/numerics_debugging/scripts/compare_numerics.py1084CODE
LOW…/skills/numerics_debugging/scripts/compare_numerics.py573CODE
LOWscripts/loss_compare.py572CODE
LOWscripts/download_hf_assets.py12CODE
LOW.github/scripts/todo_debt_tracker.py120CODE
LOW.github/scripts/todo_debt_tracker.py237CODE
LOW.github/scripts/todo_debt_tracker.py338CODE
LOWtorchtitan_recipes/tests/suites/features.py80CODE
LOWtorchtitan/trainer.py465CODE
LOWtorchtitan/trainer.py116CODE
LOWtorchtitan/tools/utils.py112CODE
LOWtorchtitan/distributed/spmd_types.py231CODE
LOWtorchtitan/distributed/fsdp.py225CODE
LOWtorchtitan/distributed/pipeline_parallel.py482CODE
LOWtorchtitan/distributed/pipeline_parallel.py595CODE
LOW…n/distributed/flex_shard/_optimizer_reshard_runtime.py128CODE
LOW…n/distributed/flex_shard/_optimizer_reshard_runtime.py420CODE
LOWtorchtitan/distributed/flex_shard/dist_muon.py1104CODE
LOWtorchtitan/distributed/flex_shard/dist_muon.py1375CODE
128 more matches not shown…
Structural Annotation Overuse100 hits · 143 pts
SeverityFileLineSnippetContext
LOW.ci/docker/common/install_conda.sh58 # WARNING: This is a HACK from PyTorch core to be able to build PyTorch on 22.04.COMMENT
LOW⚡tests/unit_tests/cpu/test_tokenizer.py366 # Step 2: Load tokenizer using our functionCOMMENT
LOW⚡tests/unit_tests/cpu/test_tokenizer.py372 # Step 3: Load tokenizer using official Tokenizer library (if available)COMMENT
LOW⚡tests/unit_tests/cpu/test_tokenizer.py379 # Step 4: Load tokenizer using transformers AutoTokenizer (if available)COMMENT
LOW⚡tests/unit_tests/cpu/test_tokenizer.py388 # Step 5: Compare underlying tokenizer attributes (only if official tokenizer is available)COMMENT
LOW⚡tests/unit_tests/cpu/test_tokenizer.py394 # Step 6: Compare with transformers tokenizer if availableCOMMENT
LOWtests/unit_tests/cpu/test_tokenizer.py351 # Step 1: Download tokenizer filesCOMMENT
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py80 0.5, # Step 0: 50% of max LR (warmup)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py81 1.0, # Step 1: 100% of max LR (warmup complete)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py82 1.0, # Step 2: We maunally added step of stable phase, to prevent LR from dropping to 0 at last stepCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py83 7.0 / 8.0, # Step 3: 7/8 of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py84 6.0 / 8.0, # Step 4: 3/4 of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py85 5.0 / 8.0, # Step 5: 5/8 of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py86 4.0 / 8.0, # Step 6: 1/2 of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py87 3.0 / 8.0, # Step 7: 3/8 of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py88 2.0 / 8.0, # Step 8: 1/4 of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py89 1.0 / 8.0, # Step 9: 1/8 of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py123 0.5, # Step 0: 50% of max LR (warmup)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py124 1.0, # Step 1: 100% of max LR (warmup complete)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py125 1.0, # Step 2: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py126 1.0, # Step 3: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py127 1.0, # Step 4: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py128 1.0, # Step 5: We maunally added step of stable phase, to prevent LR from dropping to 0 at last stepCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py129 0.8, # Step 6: Linear decay starts (80% of max LR)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py130 0.6, # Step 7: 60% of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py131 0.4, # Step 8: 40% of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py132 0.2, # Step 9: 20% of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py234 0.2, # Step 0: 50% of max LR (warmup)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py235 0.4, # Step 1: 100% of max LR (warmup complete)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py236 0.6, # Step 2: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py237 0.8, # Step 3: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py238 1.0, # Step 4: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py271 0.5, # Step 0: 50% of max LR (warmup)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py272 1.0, # Step 1: 100% of max LR (warmup complete)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py273 1.0, # Step 2: We maunally added step of stable phase, to prevent LR from dropping to 0 at last stepCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py274 1.0, # Step 3: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py275 1.0, # Step 4: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py276 1.0, # Step 5: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py277 1.0, # Step 6: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py278 1.0, # Step 7: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py279 1.0, # Step 8: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py280 1.0, # Step 9: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py314 0.2, # Step 0: 50% of max LR (warmup)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py315 0.4, # Step 1: 100% of max LR (warmup complete)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py316 0.6, # Step 2: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py317 0.8, # Step 3: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py318 1.0, # Step 4: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py319 1.0, # Step 5: We maunally added step of stable phase, to prevent LR from dropping to 0 at last stepCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py320 0.8, # Step 6: Linear decay starts (80% of max LR)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py321 0.6, # Step 7: 60% of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py322 0.4, # Step 8: 40% of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py323 0.2, # Step 9: 20% of max LRCODE
LOWdocs/release.md18## Step 1 - Validate `main` and create the release branchCOMMENT
LOWdocs/release.md83## Step 2 - Set the RC versionCOMMENT
LOWdocs/release.md104## Step 3 - Stage the RC on TestPyPICOMMENT
LOWdocs/release.md144## Step 4 - Validate the RC installationCOMMENT
LOWdocs/release.md246## Step 5 - Triage an RC validation failureCOMMENT
LOWdocs/release.md297## Step 6 - Finalize the versionCOMMENT
LOWdocs/release.md312## Step 7 - Cut the GitHub Release and publish to PyPICOMMENT
LOWdocs/release.md324## Step 8 - Verify the production PyPI releaseCOMMENT
40 more matches not shown…
Verbosity Indicators86 hits · 119 pts
SeverityFileLineSnippetContext
LOW⚡tests/unit_tests/cpu/test_tokenizer.py366 # Step 2: Load tokenizer using our functionCOMMENT
LOW⚡tests/unit_tests/cpu/test_tokenizer.py372 # Step 3: Load tokenizer using official Tokenizer library (if available)COMMENT
LOW⚡tests/unit_tests/cpu/test_tokenizer.py379 # Step 4: Load tokenizer using transformers AutoTokenizer (if available)COMMENT
LOW⚡tests/unit_tests/cpu/test_tokenizer.py388 # Step 5: Compare underlying tokenizer attributes (only if official tokenizer is available)COMMENT
LOW⚡tests/unit_tests/cpu/test_tokenizer.py394 # Step 6: Compare with transformers tokenizer if availableCOMMENT
LOWtests/unit_tests/cpu/test_tokenizer.py351 # Step 1: Download tokenizer filesCOMMENT
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py80 0.5, # Step 0: 50% of max LR (warmup)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py81 1.0, # Step 1: 100% of max LR (warmup complete)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py82 1.0, # Step 2: We maunally added step of stable phase, to prevent LR from dropping to 0 at last stepCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py83 7.0 / 8.0, # Step 3: 7/8 of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py84 6.0 / 8.0, # Step 4: 3/4 of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py85 5.0 / 8.0, # Step 5: 5/8 of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py86 4.0 / 8.0, # Step 6: 1/2 of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py87 3.0 / 8.0, # Step 7: 3/8 of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py88 2.0 / 8.0, # Step 8: 1/4 of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py89 1.0 / 8.0, # Step 9: 1/8 of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py123 0.5, # Step 0: 50% of max LR (warmup)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py124 1.0, # Step 1: 100% of max LR (warmup complete)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py125 1.0, # Step 2: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py126 1.0, # Step 3: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py127 1.0, # Step 4: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py128 1.0, # Step 5: We maunally added step of stable phase, to prevent LR from dropping to 0 at last stepCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py129 0.8, # Step 6: Linear decay starts (80% of max LR)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py130 0.6, # Step 7: 60% of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py131 0.4, # Step 8: 40% of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py132 0.2, # Step 9: 20% of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py234 0.2, # Step 0: 50% of max LR (warmup)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py235 0.4, # Step 1: 100% of max LR (warmup complete)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py236 0.6, # Step 2: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py237 0.8, # Step 3: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py238 1.0, # Step 4: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py271 0.5, # Step 0: 50% of max LR (warmup)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py272 1.0, # Step 1: 100% of max LR (warmup complete)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py273 1.0, # Step 2: We maunally added step of stable phase, to prevent LR from dropping to 0 at last stepCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py274 1.0, # Step 3: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py275 1.0, # Step 4: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py276 1.0, # Step 5: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py277 1.0, # Step 6: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py278 1.0, # Step 7: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py279 1.0, # Step 8: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py280 1.0, # Step 9: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py314 0.2, # Step 0: 50% of max LR (warmup)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py315 0.4, # Step 1: 100% of max LR (warmup complete)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py316 0.6, # Step 2: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py317 0.8, # Step 3: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py318 1.0, # Step 4: Stable phaseCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py319 1.0, # Step 5: We maunally added step of stable phase, to prevent LR from dropping to 0 at last stepCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py320 0.8, # Step 6: Linear decay starts (80% of max LR)CODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py321 0.6, # Step 7: 60% of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py322 0.4, # Step 8: 40% of max LRCODE
LOW⚡tests/unit_tests/cpu/test_lr_scheduler.py323 0.2, # Step 9: 20% of max LRCODE
LOWscripts/checkpoint_compat_test.py221 # Step 1: Reference run at load_commit (full training from scratch)COMMENT
LOWscripts/checkpoint_compat_test.py243 # Step 2: Save run at save_commit (partial training + checkpoint)COMMENT
LOWscripts/checkpoint_compat_test.py272 # Step 3: Resume run at load_commit (load checkpoint, train to end)COMMENT
LOWscripts/checkpoint_compat_test.py300 # Step 4: CompareCOMMENT
LOW⚡.github/workflows/integration_test_8gpu_torchft.yaml32 # Step 1: Dynamically compute the matrix based on conditionsCOMMENT
LOW⚡.github/workflows/integration_test_8gpu_torchft.yaml40 # Step 2: Use the dynamic matrix in the build-test jobCOMMENT
LOW⚡.github/workflows/integration_test_8gpu_rl.yaml25 # Step 1: Dynamically compute the matrix based on conditionsCOMMENT
LOW⚡.github/workflows/integration_test_8gpu_rl.yaml33 # Step 2: Use the dynamic matrix in the build-test jobCOMMENT
LOW⚡…tegration_test_8gpu_transformers_modeling_backend.yaml31 # Step 1: Dynamically compute the matrix based on conditionsCOMMENT
26 more matches not shown…
Docstring Block Structure20 hits · 100 pts
SeverityFileLineSnippetContext
HIGH…h_trace_compaction/scripts/compact_cuda_graph_trace.py185Extract measured GPU slices that have a profiler stream. Args: events: Trace event list. Returns: STRING
HIGH…h_trace_compaction/scripts/compact_cuda_graph_trace.py466Verify slice identity and non-overlap of every compacted lane. Args: original_events: Unmodified trace evenSTRING
HIGH…h_trace_compaction/scripts/compact_cuda_graph_trace.py750Remap GPU flows and annotations, and replace old stream metadata. Args: events: Events whose measured sliceSTRING
HIGH…h_trace_compaction/scripts/compact_cuda_graph_trace.py813Compact CUDA graph streams in a parsed PyTorch profiler trace. Args: trace: Parsed profiler trace. STRING
HIGHtorchtitan/distributed/utils.py510 Clip the gradient norm of an iterable of parameters. Gradient norm clipping requires computing the gradient noSTRING
HIGHtorchtitan/distributed/pipeline_parallel.py808Create pipeline stages based on specified module names for each stage. Also used by Graph PP to split the model intSTRING
HIGHtorchtitan/distributed/parallelism_context.py410Get a device mesh by axis name(s), returning None if not enabled. Args: axes: Names of the mesh axeSTRING
HIGHtorchtitan/distributed/parallelism_context.py471Get a device mesh by axis name(s), raising if not available. Args: axes: Names of the mesh axes. VaSTRING
HIGH…/experiments/transformers_modeling_backend/pipeline.py159 This API creates pipeline stages based on specified module names for each stage. Some model restrictions incluSTRING
HIGH…experiments/graph_trainer/paged_stash_memory_policy.py2853Megatron's ``_pp_schedule`` for one rank: every paged layer's forward and backward, in the order the rank runs them.STRING
HIGH…itan/experiments/graph_trainer/graph_pp/split_di_dw.py204Split a backward graph into input-gradient and weight-gradient graphs. Contract: Input: backward(saveSTRING
HIGHtorchtitan/experiments/graph_trainer/graph_pp/runner.py1065Register graph action handlers on a runtime schedule. Args: schedule (_PipelineScheduleRuntime): Runtime piSTRING
HIGH…htitan/experiments/graph_trainer/graph_pp/partition.py475Partition a post-pass GraphTrainer joint graph into GraphPP callables. The caller passes a flat ``minimal_fx_tracerSTRING
HIGH…ments/graph_trainer/graph_pp/split_fsdp_collectives.py200Extract FSDP parameter all-gather chains from a graph. Contract: unshard(param_shards_and_replicated_params) STRING
HIGH…ments/graph_trainer/graph_pp/split_fsdp_collectives.py407Extract FSDP/DDP/HSDP reduce-grad epilogues from a graph. Contract: compute(original_inputs) -> leadiSTRING
HIGH…/experiments/graph_trainer/graph_pp/graph_multiplex.py48Concatenate backward and forward graphs into one boxed GraphPP callable. Contract: ``OVERLAP_F_B`` schedule aSTRING
HIGHtorchtitan/experiments/torchft/diloco/utils.py23 This API creates fragments based on specified module names for each fragment. This method updates the model in STRING
HIGHtorchtitan/models/common/multimodal.py139Locate each visual item's placeholder run in the token sequence. Args: tokens: ``(T,)`` token IDs. STRING
HIGHtorchtitan/models/common/attention/cp_attention.py101Prepare a rank-local BlockMask for K/V all-gather CP. The returned mask covers the current rank's Q shard and tSTRING
HIGHtorchtitan/hf_datasets/multimodal/utils/video.py46Load a deterministic uint8 frame array from a NumPy file. Args: path: Path to a ``.npy`` array shaped ``(T,STRING
Over-Commented Block100 hits · 92 pts
SeverityFileLineSnippetContext
LOWrun_train.sh1#!/usr/bin/bashCOMMENT
LOW.ci/docker/common/utils.sh1#!/bin/bashCOMMENT
LOW.ci/docker/common/install_deepep.sh1#!/bin/bashCOMMENT
LOWtests/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtests/unit_tests/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtests/unit_tests/gpu/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtests/unit_tests/gpu/flex_shard/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtests/unit_tests/cpu/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtests/unit_tests/cpu/flex_shard/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtests/unit_tests/cpu/observability/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtests/rl/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtests/rl/unit_tests/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtests/rl/unit_tests/gpu/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtests/rl/unit_tests/cpu/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtests/rl/integration_tests/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOW…skills/numerics_debugging/scripts/activation_tracer.py341#COMMENT
LOW…skills/numerics_debugging/scripts/activation_tracer.py561 # record_ids populates DebugMode's _tensor_memo with a stableCOMMENT
LOW…skills/numerics_debugging/scripts/activation_tracer.py641COMMENT
LOW…/skills/numerics_debugging/scripts/compare_numerics.py61 stats: dict[str, str] = field(default_factory=dict)COMMENT
LOW…/skills/numerics_debugging/scripts/compare_numerics.py181COMMENT
LOW…/skills/numerics_debugging/scripts/compare_numerics.py661 # log_tensor_hashes. Comma-separated lists of floats — weCOMMENT
LOW.github/scripts/run_8xgpu_integration_tests.sh1#!/bin/bashCOMMENT
LOW.github/scripts/integration_test_real_pg.sh1#!/usr/bin/env bashCOMMENT
LOWtorchtitan_recipes/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan_recipes/graph_trainer/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan_recipes/tests/graph_trainer/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan_recipes/tests/suites/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan_recipes/tests/datasets/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan_recipes/tests/models/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan_recipes/tests/models/kimi_k2_7.py541 # No PP gate: DistMuon is PP-safe. The one precondition -- every stageCOMMENT
LOWtorchtitan_recipes/tests/torchft/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan_recipes/tests/rl/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan_recipes/models/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan_recipes/torchft/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan_recipes/rl/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan/tools/utils.py141 else: # for H100 SXM and other variantsCOMMENT
LOWtorchtitan/tools/utils.py181 # Dot Product Accumulate Systolic (DPAS):COMMENT
LOWtorchtitan/distributed/deepep/deepep.py81COMMENT
LOWtorchtitan/distributed/deepep/deepep.py101 "-> (Tensor, Tensor, Tensor, Tensor, Tensor)"COMMENT
LOWtorchtitan/experiments/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOW…tan/experiments/transformers_modeling_backend/model.py781 except Exception as e:COMMENT
LOW…periments/transformers_modeling_backend/parallelize.py101 4. Single model._parallelize(parallelism_context) call -- shards states, wraps forwardCOMMENT
LOW…rmers_modeling_backend/tests/test_flex_cp_numerical.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOW…iments/transformers_modeling_backend/tests/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan/experiments/graph_trainer/make_fx_tracer.py581 # engine dispatches backward to a worker thread that has aCOMMENT
LOWtorchtitan/experiments/graph_trainer/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOW…itan/experiments/graph_trainer/run_train_precompile.sh1#!/usr/bin/bashCOMMENT
LOWtorchtitan/experiments/graph_trainer/fsdp_patterns.py441 # cast_grad = grad.to(reduce_dtype)COMMENT
LOW…experiments/graph_trainer/paged_stash_memory_policy.py261 from torchtitan.components.optim.optimizer import OptimizersContainerCOMMENT
LOW…experiments/graph_trainer/paged_stash_memory_policy.py541# ``[cuda, host]`` freelist state, and the same preallocated reset values soCOMMENT
LOW…experiments/graph_trainer/paged_stash_memory_policy.py901 # individual stash rounds up to a page boundary: ``_live_pages`` is theCOMMENT
LOW…experiments/graph_trainer/paged_stash_memory_policy.py1421# Custom ops that page MoE activations in and out of the stash buffersCOMMENT
LOW…experiments/graph_trainer/paged_stash_memory_policy.py1441# dx = paged_stash.reload_next(dx, slot, prefetch)COMMENT
LOW…experiments/graph_trainer/paged_stash_memory_policy.py1461# only thing that crosses into backward, in place of the padded activation.COMMENT
LOW…experiments/graph_trainer/paged_stash_memory_policy.py1481# so this only bounds parallelism, not correctness.COMMENT
LOW…experiments/graph_trainer/paged_stash_memory_policy.py1961# Transformer Engine tagged with ``grouped_tensor_scale_inv`` inside that contextCOMMENT
LOW…experiments/graph_trainer/paged_stash_memory_policy.py2281 layer_id,COMMENT
LOW…experiments/graph_trainer/paged_stash_memory_policy.py2301# Rewrite performed for each paged layer::COMMENT
LOW…experiments/graph_trainer/paged_stash_memory_policy.py2321# ``num_tokens`` -- a few kilobytes -- are what cross into backward. UnderCOMMENT
LOW…experiments/graph_trainer/paged_stash_memory_policy.py2761# ===========================================================================COMMENT
40 more matches not shown…
Fake / Example Data90 hits · 83 pts
SeverityFileLineSnippetContext
LOW…rchtitan/experiments/graph_trainer/subgraph_regions.py97 if node.op in ("placeholder", "output", "get_attr"):CODE
LOW…rchtitan/experiments/graph_trainer/subgraph_regions.py343 if any(node.op in ("placeholder", "output") for node in ordered_nodes):CODE
LOWtorchtitan/experiments/graph_trainer/decompositions.py49 placeholders = gm.graph.find_nodes(op="placeholder")CODE
LOWtorchtitan/experiments/graph_trainer/fsdp_passes.py119 placeholders = gm.graph.find_nodes(op="placeholder")CODE
LOWtorchtitan/experiments/graph_trainer/fsdp_passes.py171 if n.all_input_nodes[0].op == "placeholder":CODE
LOWtorchtitan/experiments/graph_trainer/fsdp_passes.py1572 if n in visited or n.op in ("placeholder", "get_attr"):CODE
LOW⚡torchtitan/experiments/graph_trainer/memory_policy.py147 gm.graph.find_nodes(op="placeholder")CODE
LOWtorchtitan/experiments/graph_trainer/memory_policy.py520 node for node in required_fw_nodes if node.op in ("placeholder", "get_attr")CODE
LOWtorchtitan/experiments/graph_trainer/memory_policy.py594 if node not in required_fw_nodes or node.op in ("placeholder", "get_attr"):CODE
LOW⚡…htitan/experiments/graph_trainer/wgrad_accumulation.py137 or accumulator.op != "placeholder"CODE
LOW⚡torchtitan/experiments/graph_trainer/inductor_passes.py68 if node.op == "placeholder" and "val" in node.meta:CODE
LOW⚡torchtitan/experiments/graph_trainer/inductor_passes.py84 if node.op == "placeholder":CODE
LOW⚡torchtitan/experiments/graph_trainer/inductor_passes.py105 original_placeholders = list(gm.graph.find_nodes(op="placeholder"))CODE
LOW⚡torchtitan/experiments/graph_trainer/inductor_passes.py114 if node.op == "placeholder":CODE
LOWtorchtitan/experiments/graph_trainer/inductor_passes.py387 if node.op in ("placeholder", "output"):CODE
LOWtorchtitan/experiments/graph_trainer/fsdp_patterns.py228 for placeholder in gm.graph.find_nodes(op="placeholder"):CODE
LOWtorchtitan/experiments/graph_trainer/fsdp_patterns.py317 if node.op == "placeholder" or node.meta.get("autograd_backward", False):CODE
LOW…chtitan/experiments/graph_trainer/grad_accumulation.py79 first_compute = next(node for node in gm.graph.nodes if node.op != "placeholder")CODE
LOW⚡torchtitan/experiments/graph_trainer/ep_overlap_pass.py84_GRAPH_BOUNDARY_OPS = {"placeholder", "get_attr"}CODE
LOW…ph_trainer/spmd_gradient_accumulation_graph_builder.py296 placeholders = call_spec.module.graph.find_nodes(op="placeholder")CODE
LOWtorchtitan/experiments/graph_trainer/debug_utils.py36 if node.op == "placeholder":CODE
LOW…n/experiments/graph_trainer/tests/test_trace_module.py97 if node.op != "placeholder":CODE
LOW…n/experiments/graph_trainer/tests/test_trace_module.py400 if node.op == "placeholder"CODE
LOW…n/experiments/graph_trainer/tests/test_trace_module.py655 if node.op == "placeholder"CODE
LOW…n/experiments/graph_trainer/tests/test_trace_module.py679 if node.op == "placeholder"CODE
LOW…n/experiments/graph_trainer/tests/test_trace_module.py700 if node.op == "placeholder"CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py3582 self.assertEqual(node.args[0].op, "placeholder")CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py5073 if node.op == "placeholder":CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py5180 if node.op == "placeholder":CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py5199 self.assertEqual(node.args[0].op, "placeholder")CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py5277 self.assertEqual(relu_node.args[0].op, "placeholder")CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py5376 if node.op == "placeholder":CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py5476 if node.op == "placeholder":CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py5517 if node.op == "placeholder":CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py5847 node.target for node in compile_gm.graph.find_nodes(op="placeholder")CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py5850 node.meta for node in compile_gm.graph.find_nodes(op="placeholder")CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py5887 node.target for node in wrapped.graph.find_nodes(op="placeholder")CODE
LOW…xperiments/graph_trainer/tests/test_graph_pp_runner.py619 for node in traced.gm.graph.find_nodes(op="placeholder")CODE
LOW…xperiments/graph_trainer/tests/test_graph_pp_runner.py1630 for node in gm.graph.find_nodes(op="placeholder"):CODE
LOW…xperiments/graph_trainer/tests/test_graph_pp_runner.py1786 bw_gm.graph.find_nodes(op="placeholder")[0].meta["val"] = bw_fakeCODE
LOW…xperiments/graph_trainer/tests/test_graph_pp_runner.py1787 fw_gm.graph.find_nodes(op="placeholder")[0].meta["val"] = fw_fakeCODE
LOW…xperiments/graph_trainer/tests/test_graph_pp_runner.py1802 placeholders = multiplexed.graph.find_nodes(op="placeholder")CODE
LOW…xperiments/graph_trainer/tests/test_graph_pp_runner.py1846 fw_gm.graph.find_nodes(op="placeholder")[0].meta["val"] = fw_fakeCODE
LOW⚡…xperiments/graph_trainer/tests/test_graph_pp_passes.py2120 sharded_param, replicated_param, _ = gm.graph.find_nodes(op="placeholder")CODE
LOW⚡…xperiments/graph_trainer/tests/test_graph_pp_passes.py2132 sharded_param = gm.graph.find_nodes(op="placeholder")[0]CODE
LOW⚡…xperiments/graph_trainer/tests/test_graph_pp_passes.py2357 sharded_param = gm.graph.find_nodes(op="placeholder")[0]CODE
LOW⚡…xperiments/graph_trainer/tests/test_graph_pp_passes.py2366 sharded_param, reconstruction_input = graph.find_nodes(op="placeholder")CODE
LOW⚡…xperiments/graph_trainer/tests/test_graph_pp_passes.py2392 sharded_param = gm.graph.find_nodes(op="placeholder")[0]CODE
LOW⚡…xperiments/graph_trainer/tests/test_graph_pp_passes.py2403 sharded_param, unrelated = gm.graph.find_nodes(op="placeholder")CODE
LOW⚡…xperiments/graph_trainer/tests/test_graph_pp_passes.py2413 sharded_param = graph.find_nodes(op="placeholder")[0]CODE
LOW⚡…xperiments/graph_trainer/tests/test_graph_pp_passes.py2441 sharded_param = gm.graph.find_nodes(op="placeholder")[0]CODE
LOW⚡…xperiments/graph_trainer/tests/test_graph_pp_passes.py2453 sharded_param = gm.graph.find_nodes(op="placeholder")[0]CODE
LOW⚡…xperiments/graph_trainer/tests/test_graph_pp_passes.py2502 sharded_param = gm.graph.find_nodes(op="placeholder")[0]CODE
LOW⚡…xperiments/graph_trainer/tests/test_graph_pp_passes.py2514 sharded_param, unrelated = gm.graph.find_nodes(op="placeholder")CODE
LOW⚡…xperiments/graph_trainer/tests/test_graph_pp_passes.py2526 sharded_param = graph.find_nodes(op="placeholder")[0]CODE
LOW…xperiments/graph_trainer/tests/test_graph_pp_passes.py345 node.name: node for node in gm.graph.find_nodes(op="placeholder")CODE
LOW…xperiments/graph_trainer/tests/test_graph_pp_passes.py389 node.name: node for node in view_gm.graph.find_nodes(op="placeholder")CODE
LOW…xperiments/graph_trainer/tests/test_graph_pp_passes.py1261 return tuple(node.name for node in gm.graph.find_nodes(op="placeholder"))CODE
LOW…xperiments/graph_trainer/tests/test_graph_pp_passes.py2223 sharded_param = gm.graph.find_nodes(op="placeholder")[0]CODE
LOW…xperiments/graph_trainer/tests/test_graph_pp_passes.py2328 sharded_param = gm.graph.find_nodes(op="placeholder")[0]CODE
30 more matches not shown…
Self-Referential Comments25 hits · 80 pts
SeverityFileLineSnippetContext
MEDIUMtests/unit_tests/cpu/test_set_determinism.py46 # Create a world_mesh mockCOMMENT
MEDIUM⚡tests/unit_tests/cpu/test_lr_scheduler.py27 # Create a simple model with parametersCOMMENT
MEDIUM⚡tests/unit_tests/cpu/test_lr_scheduler.py29 # Create an optimizerCOMMENT
MEDIUM⚡tests/unit_tests/cpu/test_lr_scheduler.py36 # Create an optimizer containerCOMMENT
MEDIUMtests/unit_tests/cpu/test_lr_scheduler.py63 # Create a job config with 10 steps, 2 warmup steps, and linear decayCOMMENT
MEDIUMtests/unit_tests/cpu/test_lr_scheduler.py106 # Create a job config with 10 steps, 2 warmup steps, 3 stable steps, and 5 decay stepsCOMMENT
MEDIUMtests/unit_tests/cpu/test_lr_scheduler.py148 # Create a job config with a minimum learning rateCOMMENT
MEDIUMtests/unit_tests/cpu/test_lr_scheduler.py217 # Create a job config where warmup steps > training stepsCOMMENT
MEDIUMtests/unit_tests/cpu/test_lr_scheduler.py254 # Create a job config with 10 steps, 2 warmup steps, and no decay phaseCOMMENT
MEDIUMtests/unit_tests/cpu/test_lr_scheduler.py296 # Create a job config where warmup + decay steps > training stepsCOMMENT
MEDIUMtests/unit_tests/cpu/test_checkpoint.py978 # Create a fake model with freqs_cis and other parametersCOMMENT
MEDIUMtests/assets/cc12m_test/pack_test_dataset.py23 # Create a TarWriter object to write the dataset to a tar archiveCOMMENT
MEDIUM⚡scripts/loss_compare.py334 # Create the output folderCOMMENT
MEDIUM⚡scripts/loss_compare.py903 # Create a test caseCOMMENT
MEDIUM…ripts/checkpoint_conversion/numerical_tests_example.py151 # Define the set of outputs to test loss forCOMMENT
MEDIUM.github/scripts/update_version.sh6 # Create a variable named __version__ at the end of __init__.pyCOMMENT
MEDIUMtorchtitan/distributed/activation_checkpoint.py7# This file provides the util functions to apply activation checkpointing to the model.COMMENT
MEDIUMtorchtitan/distributed/pipeline_parallel.py614 # Create a set of modules to keep for faster lookupCOMMENT
MEDIUM…/experiments/transformers_modeling_backend/pipeline.py199 # Create a set of modules to keep for faster lookupCOMMENT
MEDIUM…chtitan/experiments/graph_trainer/tests/test_passes.py1039 # Create a second PG to simulate expert-FSDP.COMMENT
MEDIUM…experiments/graph_trainer/tests/test_custom_codegen.py206 # Create main moduleCOMMENT
MEDIUMtorchtitan/experiments/torchft/manager.py217 # Create the outer optimizer based on the inner optimizer parameters.COMMENT
MEDIUMtorchtitan/experiments/torchft/diloco/utils.py52 # Create a set of modules to keep for faster lookupCOMMENT
MEDIUMtorchtitan/models/common/moe.py172 """This class implements token-choice routing. In token-choice top-K routing, each token isSTRING
MEDIUMtorchtitan/rl/rollout/environment/token.py227 # Create a new list to avoid mutating previous statesCOMMENT
Excessive Try-Catch Wrapping63 hits · 75 pts
SeverityFileLineSnippetContext
LOWtests/unit_tests/cpu/test_tp_kv_heads_validation.py40except Exception:CODE
LOW⚡tests/unit_tests/cpu/test_tokenizer.py376 except Exception as e:CODE
LOW⚡tests/unit_tests/cpu/test_tokenizer.py385 except Exception as e:CODE
LOW⚡tests/unit_tests/cpu/test_checkpoint.py1129 except Exception as e:CODE
LOWtests/integration_tests/run_tests.py441 except Exception as e:CODE
LOWtests/integration_tests/run_tests.py455 except Exception as e:CODE
LOWtests/integration_tests/flux.py125 except Exception as e:CODE
LOWtests/rl/unit_tests/cpu/test_muse_glimmer_renderer.py220 except Exception as exc: # offline, or no access to the HubCODE
MEDIUM⚡scripts/loss_compare.py309 log_print(f"Error: Import file does not exist: {import_result}")CODE
MEDIUM⚡scripts/loss_compare.py330 log_print(f"Error: Output folder '{output_folder}' already exists")CODE
MEDIUM⚡scripts/loss_compare.py892 log_print(f"Error: No {metric_name} values found in baseline")CODE
MEDIUM⚡scripts/loss_compare.py896 log_print(f"Error: No {metric_name} values found in test")CODE
MEDIUM⚡scripts/loss_compare.py900 log_print(f"Error: No {metric_name} values found in import file")CODE
MEDIUMscripts/loss_compare.py276 log_print("Error: All settings are identical")CODE
MEDIUMscripts/loss_compare.py287 log_print(f"Error: --steps must be a positive integer, got: {steps}")CODE
MEDIUMscripts/loss_compare.py292 log_print("Error: --import-result requires --assert-equal")CODE
MEDIUMscripts/loss_compare.py782 log_print("Error: baseline-only mode requires --import-result")CODE
MEDIUMscripts/loss_compare.py794 log_print(f"Error: metric '{name}' missing from {other_name} results")CODE
MEDIUMscripts/rl/loss_compare.py302 log_print("Error: no losses found in TensorBoard events")CODE
LOW.github/scripts/todo_debt_tracker.py45 except Exception:CODE
LOW.github/scripts/todo_debt_tracker.py116 except Exception as e:CODE
LOW.github/scripts/todo_debt_tracker.py183 except Exception:CODE
LOW.github/scripts/todo_debt_tracker.py303 except Exception as e:CODE
MEDIUM.github/scripts/todo_debt_tracker.py304 print(f"Error reading {file_path}: {e}", file=sys.stderr)CODE
LOWtorchtitan/__init__.py11except Exception:CODE
LOWtorchtitan/train.py59 except Exception:CODE
LOWtorchtitan/trainer.py237 except Exception:CODE
LOW…tan/experiments/transformers_modeling_backend/model.py781 except Exception as e:CODE
LOW…_moe_model/scripts/numerical_equivalence_pretrained.py47 except Exception:CODE
LOW…_moe_model/scripts/numerical_equivalence_pretrained.py192 except Exception as e:CODE
LOW…/skills/add_moe_model/scripts/numerical_equivalence.py572 except Exception as e:CODE
LOW…/skills/add_moe_model/scripts/numerical_equivalence.py622 except Exception as e:CODE
LOWtorchtitan/experiments/graph_trainer/custom_codegen.py67 except Exception:CODE
LOWtorchtitan/experiments/graph_trainer/cpu_offload.py174 except Exception:CODE
LOWtorchtitan/experiments/graph_trainer/cpu_offload.py186 except Exception:CODE
LOW…eriments/graph_trainer/log_activation_memory_policy.py77 except Exception:CODE
LOWtorchtitan/experiments/graph_trainer/graph_pp/utils.py203 except Exception as exc:CODE
LOWtorchtitan/experiments/graph_trainer/graph_pp/utils.py223 except Exception as exc:CODE
LOWtorchtitan/models/common/dist_moe/runtime.py413 except Exception:CODE
LOWtorchtitan/observability/metrics.py491 except Exception as e:CODE
LOWtorchtitan/observability/structured_logger/README.md151 except Exception:CODE
LOWtorchtitan/components/data/loader.py187 except Exception:CODE
LOWtorchtitan/components/checkpointer/base.py68 except Exception as error:CODE
LOWtorchtitan/hf_datasets/multimodal/utils/video.py157 except Exception as e:CODE
LOWtorchtitan/hf_datasets/multimodal/utils/image.py280 except Exception as e:CODE
LOWtorchtitan/rl/controller.py433 except Exception:CODE
LOWtorchtitan/rl/controller.py438 except Exception:CODE
LOW⚡torchtitan/rl/controller.py456 except Exception:CODE
LOW⚡torchtitan/rl/controller.py461 except Exception:CODE
LOW⚡torchtitan/rl/controller.py467 except Exception:CODE
LOWtorchtitan/rl/controller.py997 except Exception:CODE
LOWtorchtitan/rl/generator.py1369 except Exception as exc:CODE
LOWtorchtitan/rl/generator.py1601 except Exception:CODE
LOWtorchtitan/rl/observability/vllm.py263 except Exception as e:CODE
LOWtorchtitan/rl/observability/vllm.py368 except Exception as e:CODE
LOWtorchtitan/rl/observability/metrics/processor.py220 except Exception:CODE
LOWtorchtitan/rl/observability/metrics/processor.py231 except Exception:CODE
LOWtorchtitan/rl/rollout/rollouter.py466 except Exception:CODE
LOWtorchtitan/rl/rollout/environment/token.py166 except Exception:CODE
LOWtorchtitan/rl/examples/search_r1/env.py91 except Exception as exc:CODE
3 more matches not shown…
Empty Error Handlers8 hits · 40 pts
SeverityFileLineSnippetContext
HIGHtorchtitan/tools/filesystem.py95except FileNotFoundError:CODE
HIGHtorchtitan/experiments/graph_trainer/custom_codegen.py155except SyntaxError:CODE
HIGHtorchtitan/experiments/graph_trainer/custom_codegen.py629except AttributeError:CODE
HIGHtorchtitan/experiments/graph_trainer/custom_codegen.py70except OSError:CODE
HIGHtorchtitan/experiments/graph_trainer/memory_policy.py107except AttributeError:CODE
HIGHtorchtitan/experiments/graph_trainer/common_utils.py398except ValueError:CODE
HIGH…chtitan/experiments/graph_trainer/tests/test_passes.py3305except ValueError:CODE
HIGHtorchtitan/rl/generator.py683except (asyncio.CancelledError, Exception):CODE
Cross-Language Confusion7 hits · 34 pts
SeverityFileLineSnippetContext
HIGHtests/unit_tests/cpu/test_override.py477 parse_cli_imports(['mod={"block_size": 256, "flag": null}']),CODE
HIGH…/skills/numerics_debugging/scripts/compare_numerics.py1016 const hidden = el.dataset.hideByCategory || el.dataset.hideByOpFilter;CODE
HIGH…/skills/numerics_debugging/scripts/compare_numerics.py1028let _opFilterTimer = null;CODE
HIGH…/skills/numerics_debugging/scripts/compare_numerics.py1037 let re = null;CODE
HIGHscripts/loss_compare.py437 log_print(" - To commit: git add -A && git commit -m 'message'")CODE
HIGH⚡…ripts/checkpoint_conversion/numerical_tests_qwen3_5.py53 """KL(softmax(b) || softmax(a)) — F.kl_div(log Q, P) computes KL(P || Q)."""STRING
HIGH…htitan/rl/examples/verifiers/terminal_bench/harness.py118 'tmux kill-server >/dev/null 2>&1 || true; rm -rf "$TMUX_TMPDIR"',CODE
Hallucination Indicators3 hits · 30 pts
SeverityFileLineSnippetContext
CRITICALtests/unit_tests/cpu/test_validate.py312 assert validator.pp_schedule.eval.call_args.kwargs.get("return_outputs") is FalseCODE
CRITICAL…n/experiments/graph_trainer/tests/test_trace_module.py2274 code_lines = trainer.engine._traced_step.gm.graph.python_code(CODE
CRITICAL…n/experiments/graph_trainer/tests/test_trace_module.py2309 code = trainer.engine._traced_step.gm.graph.python_code("self").srcCODE
AI Slop Vocabulary8 hits · 24 pts
SeverityFileLineSnippetContext
MEDIUMtests/unit_tests/gpu/test_helion_rope.py28# tests below stay robust if a sibling test (e.g. test_override.py) callsCOMMENT
MEDIUMtests/unit_tests/cpu/test_tokenizer.py178 # 2. Compare vocabularies with more comprehensive samplingCOMMENT
MEDIUMtests/unit_tests/cpu/test_tokenizer.py203 # Test a random sample of tokens (more comprehensive than just common words)COMMENT
MEDIUMtorchtitan/experiments/graph_trainer/trainer.py51 # harness builds without running initialization -- see it as disabled.COMMENT
MEDIUMtorchtitan/components/tokenizer.py378 # Process added_tokens_decoder (comprehensive special token definitions)COMMENT
MEDIUMtorchtitan/rl/distributed/routing/strategies.py198 # easy to implement, but not robust for all scenarios. Revisit with anCOMMENT
MEDIUMtorchtitan/rl/distributed/routing/strategies.py199 # more robust approach.COMMENT
MEDIUMtorchtitan/rl/examples/verifiers/rollouter.py290 # One VerifiersEnvClient.run executes a complete rollout. The harnessCOMMENT
AI Structural Patterns20 hits · 18 pts
SeverityFileLineSnippetContext
LOWtests/unit_tests/gpu/test_qwen3_5_deltanet.py350CODE
LOWtorchtitan_recipes/overrides/fused_mla.py842CODE
LOWtorchtitan/distributed/fsdp.py225CODE
LOWtorchtitan/distributed/flex_shard/dist_muon.py168CODE
LOW…periments/transformers_modeling_backend/parallelize.py198CODE
LOW…formers_modeling_backend/tests/test_moe_parallelism.py91CODE
LOW…formers_modeling_backend/tests/test_moe_parallelism.py127CODE
LOW…ents/graph_trainer/tests/test_bitwise_deterministic.py189CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py391CODE
LOW…experiments/graph_trainer/tests/_trainer_test_utils.py77CODE
LOW…riments/graph_trainer/tests/test_wgrad_accumulation.py55CODE
LOWtorchtitan/models/kimi_k2_7/model.py266CODE
LOWtorchtitan/models/kimi_k3/model.py616CODE
LOWtorchtitan/models/common/decoder.py287CODE
LOWtorchtitan/models/muse_glimmer/model.py546CODE
LOWtorchtitan/models/muse_glimmer/flavors.py276CODE
LOWtorchtitan/models/qwen3_5/model.py696CODE
LOWtorchtitan/quantization/nvfp4/linear.py525CODE
LOWtorchtitan/quantization/mxfp8/linear.py500CODE
LOWtorchtitan/hf_datasets/multimodal/utils/image.py202CODE
Redundant / Tautological Comments13 hits · 17 pts
SeverityFileLineSnippetContext
LOWtests/unit_tests/cpu/test_checkpoint.py138 # Check if this is async_with_pinned_mem mode by looking for async_stager parameterCOMMENT
LOWtests/unit_tests/cpu/test_checkpoint.py919 cfg.interval = 10 # Set interval to 10 so step 1 wouldn't normally trigger saveCODE
LOWtests/assets/cc12m_test/pack_test_dataset.py38 # Write the file and its metadata to the TarWriterCOMMENT
LOW⚡scripts/loss_compare.py328 # Check if output folder already existsCOMMENT
LOWscripts/loss_compare.py740 # Check if losses were extracted successfullyCOMMENT
LOWscripts/loss_compare.py1269 # Check if git working directory is clean before switching commitsCOMMENT
LOW…chtitan/experiments/torchft/tests/integration_tests.py104 # Check if we have enough GPUsCOMMENT
LOWtorchtitan/models/flux/validate.py148 # Set model to eval modeCOMMENT
LOWtorchtitan/models/flux/model/state_dict_adapter.py41 # Check if safetensors index file existsCOMMENT
LOWtorchtitan/observability/metrics.py263 # Check if the loss-visible rank is included in LOG_RANK environment variableCOMMENT
LOWtorchtitan/observability/metrics.py443 # Check if any logging backend is enabledCOMMENT
LOWtorchtitan/components/validate.py153 # Set model to eval modeCOMMENT
LOWtorchtitan/rl/generate.py236 # Print resultsCOMMENT
Modern AI Meta-Vocabulary5 hits · 15 pts
SeverityFileLineSnippetContext
MEDIUMtests/rl/unit_tests/cpu/test_muse_glimmer_renderer.py358 # Header scaffolding must never be trainable.COMMENT
MEDIUMtests/rl/unit_tests/cpu/test_muse_glimmer_renderer.py396 # ...and header scaffolding is not content on any role.COMMENT
MEDIUMtorchtitan/rl/examples/search_r1/README.md1# Search-R1: multi-turn retrieval-augmented GRPOCOMMENT
MEDIUMtorchtitan/rl/model/muse_glimmer/renderer.py472 # emits its own stop token; on history roles it is template scaffolding.COMMENT
MEDIUMtorchtitan/rl/model/muse_glimmer/renderer.py624 # header scaffolding is excluded on every role.COMMENT
AI Response Leakage1 hit · 2 pts
SeverityFileLineSnippetContext
HIGHtorchtitan/rl/generator.py711 # The loop now executes the decision. In this example: STEP.STRING
TODO Padding1 hit · 2 pts
SeverityFileLineSnippetContext
LOWtorchtitan/rl/examples/verifiers/data.py46 # TODO: implement this as a SourceConfig and reuse SingleDatasetConfig onceCOMMENT