Repository Analysis

pytorch/torchtitan

A PyTorch native platform for training generative AI models

20.0 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of pytorch/torchtitan, a Python project with 5,675 GitHub stars. SynthScan v2.0 examined 176,027 lines of code across 665 source files, recording 2985 pattern matches distributed across 20 syntactic categories. The overall adjusted score of 20.0 places this repository in the Moderate AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

20.0
Adjusted Score
20.0
Raw Score
100%
Time Factor
2026-08-29
Last Push
5.7K
Stars
Python
Language
176.0K
Lines of Code
665
Files
3.0K
Pattern Hits
2026-08-29
Scan Date
0.04
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 28MEDIUM 210LOW 2747

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 2985 distinct pattern matches across 20 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. 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 diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Hyper-Verbose Identifiers1792 hits · 1674 pts
SeverityFileLineSnippetContext
LOWtests/unit_tests/test_kda_attention.py87 def test_varlen_matches_independent_documents(self):CODE
LOWtests/unit_tests/test_qwen3_5_mrope_positions.py104 def test_multimodal_batch_routes_mrope_to_layers(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu.py76 def test_gate_up_projection_is_linear(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu.py85 def test_preserves_converted_linear_config(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu.py97 def test_saves_in_stock_layout(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu.py106 def test_fused_checkpoint_loads_into_stock(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu.py118 def test_stock_checkpoint_loads_into_fused(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu.py148 def test_strict_load_reports_missing(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu.py172 def test_dist_gemm_config_keeps_overlap(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu.py202 def test_hf_adapter_roundtrip(self):CODE
LOWtests/unit_tests/gpu/test_compile_regional_inductor.py36 def test_inductor_backend_left_unchanged(self):CODE
LOWtests/unit_tests/gpu/test_compile_regional_inductor.py41 def test_aot_eager_with_flex_scoops(self):CODE
LOWtests/unit_tests/gpu/test_compile_regional_inductor.py46 def test_aot_eager_without_flex_left_unchanged(self):CODE
LOWtests/unit_tests/gpu/test_compile_regional_inductor.py51 def test_other_backend_with_flex_raises(self):CODE
LOWtests/unit_tests/gpu/test_compile_regional_inductor.py56 def test_region_annotation_follows_flag(self):CODE
LOWtests/unit_tests/gpu/test_compile_regional_inductor.py90 def _triton_flex_kernel_count(backend) -> int:CODE
LOWtests/unit_tests/gpu/test_compile_regional_inductor.py118 def test_plain_aot_eager_decomposes_flex(self):CODE
LOWtests/unit_tests/gpu/test_compile_regional_inductor.py122 def test_regional_scoop_lowers_flex_to_triton(self):CODE
LOWtests/unit_tests/gpu/test_activation_checkpoint.py218 def test_force_recompute_mm_fqns(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu_override.py31def _build_fused_grouped_experts() -> FusedGroupedExperts:CODE
LOWtests/unit_tests/gpu/test_fused_swiglu_override.py44 def test_minimal_async_ep_config_imports_override(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu_override.py52 def test_grouped_experts_config_is_replaced(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu_override.py68 def test_saves_and_loads_stock_layout(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu_override.py82 def test_built_module_has_only_fused_params(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu_override.py143 def test_matches_unfused_forward_and_backward(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu_override.py195 def test_silu_and_mul_custom_op_matches_reference_with_offsets(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu_override.py216 def test_silu_and_mul_custom_op_matches_reference_without_offsets(self):CODE
LOWtests/unit_tests/gpu/test_fused_swiglu_override.py236 def test_silu_and_mul_kernels_match_reference_with_offsets(self):CODE
LOWtests/unit_tests/gpu/test_kimi_k3.py121 def test_attention_gym_kda_kernel_matches_recurrent_reference(self):CODE
LOWtests/unit_tests/gpu/test_kimi_k3.py193 def test_state_dict_round_trips_through_hf_adapter(self):CODE
LOWtests/unit_tests/gpu/test_minimal_async_ep_kernels.py36 def test_topk_index_kernels_match_reference(self):CODE
LOWtests/unit_tests/gpu/test_minimal_async_ep_kernels.py192 def test_metadata_kernels_match_reference(self):CODE
LOWtests/unit_tests/gpu/test_minimal_async_ep_kernels.py298 def test_copy_kernels_handle_strides_and_active_row_masks(self):CODE
LOWtests/unit_tests/gpu/test_qwen3_5_deltanet.py27def _torch_native_gated_delta(CODE
LOWtests/unit_tests/gpu/test_qwen3_5_deltanet.py76def _torch_native_gated_delta_varlen(CODE
LOWtests/unit_tests/gpu/test_qwen3_5_deltanet.py171 def test_flex_masks_ignore_padding_position_resets(self):CODE
LOWtests/unit_tests/gpu/test_qwen3_5_deltanet.py189 def test_flex_masks_include_delta_net_varlen_metadata(self):CODE
LOWtests/unit_tests/gpu/test_qwen3_5_deltanet.py377 def test_extracted_forward_matches_main(self):CODE
LOWtests/unit_tests/gpu/test_qwen3_5_deltanet.py399 def _assert_packed_run_matches_per_document(self, model, x, positions, masks):CODE
LOWtests/unit_tests/gpu/test_qwen3_5_deltanet.py420 def test_varlen_matches_independent_document_forwards(self):CODE
LOWtests/unit_tests/gpu/test_qwen3_5_deltanet.py437 def test_get_attention_masks_pairs_flex_mask_with_deltanet_offsets(self):CODE
LOWtests/unit_tests/gpu/test_qwen3_5_deltanet.py506 def _assert_fla_varlen_matches_per_document(CODE
LOWtests/unit_tests/gpu/test_qwen3_5_deltanet.py590 def test_fla_chunked_varlen_matches_independent_document_forwards(self):CODE
LOWtests/unit_tests/gpu/test_qwen3_5_deltanet.py598 def test_fla_fused_recurrent_varlen_matches_independent_document_forwards(self):CODE
LOWtests/unit_tests/gpu/test_qwen3_5_deltanet.py603 def test_varlen_offsets_are_fresh_per_deltanet_invocation(self):CODE
LOWtests/unit_tests/gpu/test_qk_clip.py38 def test_attention_records_training_maxima_only(self) -> None:CODE
LOWtests/unit_tests/gpu/test_qk_clip.py86 def test_optimizer_hook_runs_qk_clip(self) -> None:CODE
LOWtests/unit_tests/gpu/test_qk_clip.py137 def test_reduces_head_maxima_and_clips_local_dtensor_weights(self) -> None:CODE
LOWtests/unit_tests/gpu/test_qk_clip.py230 def test_weight_scaling_is_communication_free(self) -> None:CODE
LOWtests/unit_tests/gpu/test_compile_moe.py46 def test_async_tp_requires_model_compile(self):CODE
LOWtests/unit_tests/gpu/test_compile_moe.py64 def test_apply_compile_configures_async_tp(self):CODE
LOWtests/unit_tests/gpu/test_compile_moe.py94 def test_grouped_mm_compiles_and_runs(self):CODE
LOWtests/unit_tests/gpu/test_helion_rope.py86 def test_registered_against_cossin(self):CODE
LOWtests/unit_tests/gpu/test_helion_rope.py91 def test_registered_against_complex(self):CODE
LOWtests/unit_tests/gpu/test_helion_rope.py96 def test_cossin_factory_preserves_fields(self):CODE
LOWtests/unit_tests/gpu/test_helion_rope.py296 def test_forward_matches_cossin(self):CODE
LOWtests/unit_tests/gpu/test_helion_rope.py305 def test_forward_matches_with_implicit_positions(self):CODE
LOWtests/unit_tests/gpu/test_helion_rope.py313 def test_complex_forward_matches(self):CODE
LOWtests/unit_tests/gpu/test_helion_rope.py322 def test_complex_forward_matches_with_implicit_positions(self):CODE
LOWtests/unit_tests/gpu/test_helion_rope.py329 def test_backward_matches_cossin(self):CODE
1732 more matches not shown…
Decorative Section Separators165 hits · 571 pts
SeverityFileLineSnippetContext
MEDIUMtests/unit_tests/cpu/test_tp_kv_heads_validation.py109 # ------------------------------------------------------------------COMMENT
MEDIUMtests/unit_tests/cpu/test_tp_kv_heads_validation.py111 # ------------------------------------------------------------------COMMENT
MEDIUMtests/unit_tests/cpu/test_tp_kv_heads_validation.py119 # ------------------------------------------------------------------COMMENT
MEDIUMtests/unit_tests/cpu/test_tp_kv_heads_validation.py121 # ------------------------------------------------------------------COMMENT
MEDIUMtests/unit_tests/cpu/test_tp_kv_heads_validation.py129 # ------------------------------------------------------------------COMMENT
MEDIUMtests/unit_tests/cpu/test_tp_kv_heads_validation.py131 # ------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py86# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py88# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py319# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py321# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py510# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py512# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py649# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py651# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py705# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py707# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py755# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py757# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py1525# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py1527# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py47# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py49# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py298# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py300# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py544# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py546# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py790# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py792# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py990# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py992# ---------------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py1209 # ------------------------------------------------------------------COMMENT
MEDIUM…nit_tests/cpu/observability/test_structured_logging.py1215 # ------------------------------------------------------------------COMMENT
MEDIUMscripts/loss_compare.py332# =============================================================================COMMENT
MEDIUMscripts/loss_compare.py334# =============================================================================COMMENT
MEDIUMscripts/loss_compare.py78# =============================================================================COMMENT
MEDIUMscripts/loss_compare.py80# =============================================================================COMMENT
MEDIUMscripts/loss_compare.py105# =============================================================================COMMENT
MEDIUMscripts/loss_compare.py107# =============================================================================COMMENT
MEDIUMscripts/loss_compare.py241# =============================================================================COMMENT
MEDIUMscripts/loss_compare.py243# =============================================================================COMMENT
MEDIUMscripts/loss_compare.py445# =============================================================================COMMENT
MEDIUMscripts/loss_compare.py447# =============================================================================COMMENT
MEDIUMscripts/loss_compare.py530# =============================================================================COMMENT
MEDIUMscripts/loss_compare.py532# =============================================================================COMMENT
MEDIUMscripts/loss_compare.py605# =============================================================================COMMENT
MEDIUMscripts/loss_compare.py607# =============================================================================COMMENT
MEDIUMscripts/loss_compare.py928# =============================================================================COMMENT
MEDIUMscripts/loss_compare.py930# =============================================================================COMMENT
MEDIUMscripts/loss_compare.py972# =============================================================================COMMENT
MEDIUMscripts/loss_compare.py974# =============================================================================COMMENT
MEDIUM…ripts/checkpoint_conversion/numerical_tests_qwen3_5.py47# ============================================================COMMENT
MEDIUM…ripts/checkpoint_conversion/numerical_tests_qwen3_5.py49# ============================================================COMMENT
MEDIUM…ripts/checkpoint_conversion/numerical_tests_qwen3_5.py76# ============================================================COMMENT
MEDIUM…ripts/checkpoint_conversion/numerical_tests_qwen3_5.py78# ============================================================COMMENT
MEDIUM…ripts/checkpoint_conversion/numerical_tests_qwen3_5.py230# ============================================================COMMENT
MEDIUM…ripts/checkpoint_conversion/numerical_tests_qwen3_5.py232# ============================================================COMMENT
MEDIUM…ripts/checkpoint_conversion/numerical_tests_qwen3_5.py263# ============================================================COMMENT
MEDIUM…ripts/checkpoint_conversion/numerical_tests_qwen3_5.py265# ============================================================COMMENT
MEDIUM…ripts/checkpoint_conversion/numerical_tests_qwen3_5.py322# ============================================================COMMENT
MEDIUM…ripts/checkpoint_conversion/numerical_tests_qwen3_5.py324# ============================================================COMMENT
105 more matches not shown…
Unused Imports321 hits · 308 pts
SeverityFileLineSnippetContext
LOWtorchtitan/overrides/helion_rope.py37CODE
LOWtorchtitan/overrides/moe_token_dispatcher.py40CODE
LOWtorchtitan/tools/filesystem.py15CODE
LOWtorchtitan/distributed/spmd_types.py9CODE
LOWtorchtitan/distributed/fsdp.py25CODE
LOWtorchtitan/distributed/linear.py28CODE
LOWtorchtitan/distributed/__init__.py7CODE
LOWtorchtitan/distributed/utils.py7CODE
LOWtorchtitan/distributed/parallel_dims.py7CODE
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/distributed/context_parallel/__init__.py19CODE
LOWtorchtitan/distributed/context_parallel/__init__.py19CODE
LOWtorchtitan/distributed/context_parallel/__init__.py19CODE
LOWtorchtitan/distributed/context_parallel/api.py25CODE
LOWtorchtitan/distributed/minimal_async_ep/__init__.py7CODE
LOWtorchtitan/distributed/minimal_async_ep/__init__.py7CODE
LOWtorchtitan/distributed/minimal_async_ep/__init__.py7CODE
LOWtorchtitan/distributed/minimal_async_ep/__init__.py7CODE
LOWtorchtitan/distributed/minimal_async_ep/__init__.py7CODE
LOWtorchtitan/config/__init__.py15CODE
LOWtorchtitan/config/__init__.py15CODE
LOWtorchtitan/config/__init__.py15CODE
LOWtorchtitan/config/__init__.py15CODE
LOWtorchtitan/config/__init__.py15CODE
LOWtorchtitan/config/__init__.py22CODE
LOWtorchtitan/config/__init__.py23CODE
LOWtorchtitan/config/__init__.py24CODE
LOWtorchtitan/config/__init__.py25CODE
LOWtorchtitan/config/__init__.py25CODE
LOWtorchtitan/config/__init__.py25CODE
LOWtorchtitan/config/__init__.py25CODE
LOWtorchtitan/config/__init__.py25CODE
LOWtorchtitan/config/__init__.py25CODE
LOWtorchtitan/config/override.py32CODE
LOW…formers_modeling_backend/tests/test_moe_parallelism.py60CODE
LOWtorchtitan/experiments/graph_trainer/precompile.py7CODE
LOWtorchtitan/experiments/graph_trainer/precompile.py101CODE
LOWtorchtitan/experiments/graph_trainer/fsdp_passes.py14CODE
LOWtorchtitan/experiments/graph_trainer/ep_eager_chunk.py14CODE
LOWtorchtitan/experiments/graph_trainer/custom_codegen.py9CODE
LOWtorchtitan/experiments/graph_trainer/ep_pass_utils.py21CODE
LOWtorchtitan/experiments/graph_trainer/registry.py14CODE
LOWtorchtitan/experiments/graph_trainer/graph_utils.py11CODE
LOWtorchtitan/experiments/graph_trainer/memory_policy.py16CODE
LOWtorchtitan/experiments/graph_trainer/memory_policy.py52CODE
LOWtorchtitan/experiments/graph_trainer/inductor_passes.py15CODE
LOWtorchtitan/experiments/graph_trainer/storage.py7CODE
LOW…tan/experiments/graph_trainer/ep_process_group_pass.py17CODE
LOW…eriments/graph_trainer/log_activation_memory_policy.py9CODE
LOWtorchtitan/experiments/graph_trainer/ep_chunk_pass.py62CODE
LOWtorchtitan/experiments/graph_trainer/passes.py26CODE
LOWtorchtitan/experiments/graph_trainer/passes.py80CODE
261 more matches not shown…
Structural Annotation Overuse97 hits · 139 pts
SeverityFileLineSnippetContext
LOW.ci/docker/common/install_conda.sh55 # WARNING: This is a HACK from PyTorch core to be able to build PyTorch on 22.04.COMMENT
LOWtests/unit_tests/cpu/test_tokenizer.py366 # Step 2: Load tokenizer using our functionCOMMENT
LOWtests/unit_tests/cpu/test_tokenizer.py372 # Step 3: Load tokenizer using official Tokenizer library (if available)COMMENT
LOWtests/unit_tests/cpu/test_tokenizer.py379 # Step 4: Load tokenizer using transformers AutoTokenizer (if available)COMMENT
LOWtests/unit_tests/cpu/test_tokenizer.py388 # Step 5: Compare underlying tokenizer attributes (only if official tokenizer is available)COMMENT
LOWtests/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
LOWtests/unit_tests/cpu/test_lr_scheduler.py103 0.5, # Step 0: 50% of max LR (warmup)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py104 1.0, # Step 1: 100% of max LR (warmup complete)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py105 1.0, # Step 2: We maunally added step of stable phase, to prevent LR from dropping to 0 at last stepCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py106 7.0 / 8.0, # Step 3: 7/8 of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py107 6.0 / 8.0, # Step 4: 3/4 of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py108 5.0 / 8.0, # Step 5: 5/8 of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py109 4.0 / 8.0, # Step 6: 1/2 of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py110 3.0 / 8.0, # Step 7: 3/8 of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py111 2.0 / 8.0, # Step 8: 1/4 of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py112 1.0 / 8.0, # Step 9: 1/8 of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py146 0.5, # Step 0: 50% of max LR (warmup)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py147 1.0, # Step 1: 100% of max LR (warmup complete)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py148 1.0, # Step 2: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py149 1.0, # Step 3: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py150 1.0, # Step 4: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py151 1.0, # Step 5: We maunally added step of stable phase, to prevent LR from dropping to 0 at last stepCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py152 0.8, # Step 6: Linear decay starts (80% of max LR)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py153 0.6, # Step 7: 60% of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py154 0.4, # Step 8: 40% of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py155 0.2, # Step 9: 20% of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py212 0.2, # Step 0: 50% of max LR (warmup)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py213 0.4, # Step 1: 100% of max LR (warmup complete)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py214 0.6, # Step 2: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py215 0.8, # Step 3: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py216 1.0, # Step 4: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py249 0.5, # Step 0: 50% of max LR (warmup)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py250 1.0, # Step 1: 100% of max LR (warmup complete)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py251 1.0, # Step 2: We maunally added step of stable phase, to prevent LR from dropping to 0 at last stepCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py252 1.0, # Step 3: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py253 1.0, # Step 4: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py254 1.0, # Step 5: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py255 1.0, # Step 6: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py256 1.0, # Step 7: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py257 1.0, # Step 8: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py258 1.0, # Step 9: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py292 0.2, # Step 0: 50% of max LR (warmup)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py293 0.4, # Step 1: 100% of max LR (warmup complete)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py294 0.6, # Step 2: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py295 0.8, # Step 3: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py296 1.0, # Step 4: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py297 1.0, # Step 5: We maunally added step of stable phase, to prevent LR from dropping to 0 at last stepCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py298 0.8, # Step 6: Linear decay starts (80% of max LR)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py299 0.6, # Step 7: 60% of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py300 0.4, # Step 8: 40% of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py301 0.2, # Step 9: 20% of max LRCODE
LOWscripts/checkpoint_compat_test.py228 # Step 1: Reference run at load_commit (full training from scratch)COMMENT
LOWscripts/checkpoint_compat_test.py237 # Step 2: Save run at save_commit (partial training + checkpoint)COMMENT
LOWscripts/checkpoint_compat_test.py253 # Step 3: Resume run at load_commit (load checkpoint, train to end)COMMENT
LOWscripts/checkpoint_compat_test.py268 # 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.yaml30 # Step 1: Dynamically compute the matrix based on conditionsCOMMENT
LOW.github/workflows/integration_test_8gpu_rl.yaml40 # Step 2: Use the dynamic matrix in the build-test jobCOMMENT
37 more matches not shown…
Deep Nesting147 hits · 136 pts
SeverityFileLineSnippetContext
LOWtests/unit_tests/gpu/test_fsdp_moe_sharding.py67CODE
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.py32CODE
LOWtests/unit_tests/cpu/test_embedding.py110CODE
LOWtests/unit_tests/cpu/test_validator_frequency.py13CODE
LOWtests/unit_tests/cpu/test_loss.py360CODE
LOWtests/integration_tests/run_tests.py137CODE
LOWtests/integration_tests/run_tests.py390CODE
LOWtests/assets/cc12m_test/pack_test_dataset.py13CODE
LOW…h_trace_compaction/scripts/compact_cuda_graph_trace.py690CODE
LOW…h_trace_compaction/scripts/compact_cuda_graph_trace.py740CODE
LOW…skills/numerics_debugging/scripts/activation_tracer.py424CODE
LOW…skills/numerics_debugging/scripts/activation_tracer.py455CODE
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.py610CODE
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/trainer.py274CODE
LOWtorchtitan/trainer.py774CODE
LOWtorchtitan/trainer.py943CODE
LOWtorchtitan/trainer.py198CODE
LOWtorchtitan/trainer.py219CODE
LOWtorchtitan/tools/utils.py140CODE
LOWtorchtitan/distributed/spmd_types.py231CODE
LOWtorchtitan/distributed/fsdp.py168CODE
LOWtorchtitan/distributed/activation_checkpoint.py31CODE
LOWtorchtitan/distributed/activation_checkpoint.py72CODE
LOWtorchtitan/distributed/pipeline_parallel.py357CODE
LOWtorchtitan/distributed/pipeline_parallel.py470CODE
LOW…n/distributed/flex_shard/_optimizer_reshard_runtime.py128CODE
LOW…n/distributed/flex_shard/_optimizer_reshard_runtime.py419CODE
LOWtorchtitan/distributed/flex_shard/dist_muon.py1134CODE
LOWtorchtitan/distributed/flex_shard/dist_muon.py1397CODE
LOWtorchtitan/distributed/flex_shard/dist_muon.py486CODE
LOW…/distributed/flex_shard/_optimizer_reshard_schedule.py812CODE
LOW…/distributed/flex_shard/_optimizer_reshard_schedule.py943CODE
LOWtorchtitan/config/configurable.py162CODE
LOWtorchtitan/config/configurable.py46CODE
LOWtorchtitan/config/configurable.py75CODE
LOWtorchtitan/config/configurable.py49CODE
LOWtorchtitan/config/manager.py48CODE
LOW…nts/transformers_modeling_backend/module_conversion.py42CODE
LOW…tan/experiments/transformers_modeling_backend/model.py815CODE
LOW…tan/experiments/transformers_modeling_backend/model.py524CODE
LOW…tan/experiments/transformers_modeling_backend/model.py894CODE
LOW…/experiments/transformers_modeling_backend/pipeline.py39CODE
LOW…/experiments/transformers_modeling_backend/pipeline.py148CODE
LOW…/experiments/transformers_modeling_backend/pipeline.py191CODE
LOW…ments/transformers_modeling_backend/moe_replacement.py92CODE
LOW…_moe_model/scripts/numerical_equivalence_pretrained.py147CODE
LOW…/skills/add_moe_model/scripts/numerical_equivalence.py523CODE
87 more matches not shown…
Verbosity Indicators87 hits · 122 pts
SeverityFileLineSnippetContext
LOWtests/unit_tests/cpu/test_tokenizer.py366 # Step 2: Load tokenizer using our functionCOMMENT
LOWtests/unit_tests/cpu/test_tokenizer.py372 # Step 3: Load tokenizer using official Tokenizer library (if available)COMMENT
LOWtests/unit_tests/cpu/test_tokenizer.py379 # Step 4: Load tokenizer using transformers AutoTokenizer (if available)COMMENT
LOWtests/unit_tests/cpu/test_tokenizer.py388 # Step 5: Compare underlying tokenizer attributes (only if official tokenizer is available)COMMENT
LOWtests/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
LOWtests/unit_tests/cpu/test_lr_scheduler.py103 0.5, # Step 0: 50% of max LR (warmup)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py104 1.0, # Step 1: 100% of max LR (warmup complete)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py105 1.0, # Step 2: We maunally added step of stable phase, to prevent LR from dropping to 0 at last stepCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py106 7.0 / 8.0, # Step 3: 7/8 of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py107 6.0 / 8.0, # Step 4: 3/4 of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py108 5.0 / 8.0, # Step 5: 5/8 of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py109 4.0 / 8.0, # Step 6: 1/2 of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py110 3.0 / 8.0, # Step 7: 3/8 of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py111 2.0 / 8.0, # Step 8: 1/4 of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py112 1.0 / 8.0, # Step 9: 1/8 of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py146 0.5, # Step 0: 50% of max LR (warmup)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py147 1.0, # Step 1: 100% of max LR (warmup complete)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py148 1.0, # Step 2: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py149 1.0, # Step 3: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py150 1.0, # Step 4: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py151 1.0, # Step 5: We maunally added step of stable phase, to prevent LR from dropping to 0 at last stepCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py152 0.8, # Step 6: Linear decay starts (80% of max LR)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py153 0.6, # Step 7: 60% of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py154 0.4, # Step 8: 40% of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py155 0.2, # Step 9: 20% of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py212 0.2, # Step 0: 50% of max LR (warmup)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py213 0.4, # Step 1: 100% of max LR (warmup complete)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py214 0.6, # Step 2: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py215 0.8, # Step 3: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py216 1.0, # Step 4: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py249 0.5, # Step 0: 50% of max LR (warmup)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py250 1.0, # Step 1: 100% of max LR (warmup complete)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py251 1.0, # Step 2: We maunally added step of stable phase, to prevent LR from dropping to 0 at last stepCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py252 1.0, # Step 3: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py253 1.0, # Step 4: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py254 1.0, # Step 5: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py255 1.0, # Step 6: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py256 1.0, # Step 7: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py257 1.0, # Step 8: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py258 1.0, # Step 9: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py292 0.2, # Step 0: 50% of max LR (warmup)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py293 0.4, # Step 1: 100% of max LR (warmup complete)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py294 0.6, # Step 2: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py295 0.8, # Step 3: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py296 1.0, # Step 4: Stable phaseCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py297 1.0, # Step 5: We maunally added step of stable phase, to prevent LR from dropping to 0 at last stepCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py298 0.8, # Step 6: Linear decay starts (80% of max LR)CODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py299 0.6, # Step 7: 60% of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py300 0.4, # Step 8: 40% of max LRCODE
LOWtests/unit_tests/cpu/test_lr_scheduler.py301 0.2, # Step 9: 20% of max LRCODE
LOWscripts/checkpoint_compat_test.py228 # Step 1: Reference run at load_commit (full training from scratch)COMMENT
LOWscripts/checkpoint_compat_test.py237 # Step 2: Save run at save_commit (partial training + checkpoint)COMMENT
LOWscripts/checkpoint_compat_test.py253 # Step 3: Resume run at load_commit (load checkpoint, train to end)COMMENT
LOWscripts/checkpoint_compat_test.py268 # 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.yaml30 # Step 1: Dynamically compute the matrix based on conditionsCOMMENT
LOW.github/workflows/integration_test_8gpu_rl.yaml40 # 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
27 more matches not shown…
Modern Structural Boilerplate111 hits · 112 pts
SeverityFileLineSnippetContext
LOWtests/integration_tests/__init__.py12__all__ = [CODE
LOW…skills/numerics_debugging/scripts/activation_tracer.py377def set_numerics_capture_active(active: bool) -> None:CODE
LOW…skills/numerics_debugging/scripts/activation_tracer.py873 def _setup(self) -> None:CODE
LOWtorchtitan/overrides/fused_mla.py77__all__ = [CODE
LOWtorchtitan/overrides/helion_rope.py69__all__ = ["HelionComplexRoPE", "HelionCosSinRoPE", "HelionRoPE"]CODE
LOWtorchtitan/overrides/fused_swiglu.py79__all__ = [CODE
LOWtorchtitan/distributed/spmd_types.py33__all__ = [CODE
LOWtorchtitan/distributed/__init__.py9__all__ = [CODE
LOWtorchtitan/distributed/utils.py39def set_spmd_backend(spmd_backend: str) -> None:CODE
LOWtorchtitan/distributed/utils.py318def set_batch_invariance(enable: bool) -> None:CODE
LOWtorchtitan/distributed/parallel_dims.py21__all__ = [CODE
LOWtorchtitan/distributed/pipeline_parallel.py38__all__ = ["pipeline_llm", "pipeline_vlm"]CODE
LOWtorchtitan/distributed/flex_shard/dist_muon.py53__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.py543__all__ = [CODE
LOWtorchtitan/distributed/context_parallel/__init__.py21__all__ = [CODE
LOWtorchtitan/distributed/minimal_async_ep/__init__.py15__all__ = [CODE
LOWtorchtitan/distributed/minimal_async_ep/api.py1017__all__ = [CODE
LOWtorchtitan/config/configurable.py15logger = logging.getLogger(__name__)CODE
LOWtorchtitan/config/__init__.py34__all__ = [CODE
LOW…/experiments/transformers_modeling_backend/__init__.py16__all__ = [CODE
LOW…periments/transformers_modeling_backend/hf_sharding.py242def _set_layer_sharding_configs(layer: nn.Module, *, enable_sp: bool) -> None:CODE
LOWtorchtitan/experiments/graph_trainer/custom_codegen.py418 def _setup_custom_codegen(self) -> None:CODE
LOWtorchtitan/experiments/graph_trainer/ep_chunk_pass.py185def _set_direction_meta(node: fx.Node, *, is_backward: bool) -> None:CODE
LOWtorchtitan/experiments/graph_trainer/ep_overlap_pass.py159def _set_copy_non_blocking(node: fx.Node, non_blocking: bool) -> None:CODE
LOW…ents/graph_trainer/tests/test_bitwise_deterministic.py71def _set_deterministic(seed: int = SEED) -> None:CODE
LOW…xperiments/graph_trainer/tests/test_sac_peak_memory.py30def _set_deterministic() -> None:CODE
LOW…xperiments/graph_trainer/tests/test_graph_pp_passes.py419 def _setup(self) -> None:CODE
LOWtorchtitan/experiments/graph_trainer/graph_pp/runner.py46__all__ = [CODE
LOW…chtitan/experiments/graph_trainer/graph_pp/__init__.py25__all__ = [CODE
LOWtorchtitan/experiments/torchft/__init__.py14__all__ = [CODE
LOWtorchtitan/experiments/torchft/optimizer.py19__all__ = ["TorchFTOptimizersContainer"]CODE
LOWtorchtitan/experiments/torchft/config/__init__.py10__all__ = [CODE
LOW…chtitan/experiments/torchft/tests/integration_tests.py16logger = logging.getLogger(__name__)CODE
LOWtorchtitan/experiments/torchft/diloco/__init__.py9__all__ = [CODE
LOWtorchtitan/experiments/forge/__init__.py9__all__ = ["ForgeEngine"]CODE
LOWtorchtitan/experiments/rl/controller.py140logger = logging.getLogger(__name__)CODE
LOWtorchtitan/experiments/rl/renderer.py16logger = logging.getLogger(__name__)CODE
LOWtorchtitan/experiments/rl/__init__.py47__all__ = [CODE
LOWtorchtitan/experiments/rl/train.py38logger = logging.getLogger(__name__)CODE
LOWtorchtitan/experiments/rl/batch_invariance.py22logger = logging.getLogger(__name__)CODE
LOWtorchtitan/experiments/rl/losses/__init__.py10__all__ = ["DAPOLoss", "GRPOLoss"]CODE
LOWtorchtitan/experiments/rl/tests/test_bitwise_parity.py93logger = logging.getLogger(__name__)CODE
LOWtorchtitan/experiments/rl/tests/test_bitwise_parity.py188def _set_generator_determinism(debug) -> None:CODE
LOWtorchtitan/experiments/rl/models/attention.py34logger = logging.getLogger(__name__)CODE
LOW…titan/experiments/rl/observability/metrics/__init__.py14__all__ = [CODE
LOW…itan/experiments/rl/observability/metrics/processor.py30__all__ = [CODE
LOW…rchtitan/experiments/rl/observability/metrics/types.py17__all__ = [CODE
LOWtorchtitan/experiments/rl/rollout/rollouter.py39logger = logging.getLogger(__name__)CODE
LOWtorchtitan/experiments/rl/rollout/__init__.py17__all__ = [CODE
LOWtorchtitan/experiments/rl/components/batcher.py26logger = logging.getLogger(__name__)CODE
LOWtorchtitan/experiments/rl/rubrics/__init__.py9__all__ = ["RewardFn", "Rubric", "RubricOutput"]CODE
LOWtorchtitan/experiments/rl/examples/search_r1/rubric.py127__all__ = ["RewardExactMatch"]CODE
LOWtorchtitan/experiments/rl/examples/search_r1/env.py26logger = logging.getLogger(__name__)CODE
LOW…rchtitan/experiments/rl/examples/search_r1/__init__.py15__all__ = [CODE
LOW…htitan/experiments/rl/examples/alphabet_sort/rubric.py116__all__ = ["RewardAlphabetSort", "score_sorted_list"]STRING
LOW…itan/experiments/rl/examples/alphabet_sort/__init__.py18__all__ = [CODE
LOW…rchtitan/experiments/rl/examples/dapo_math/__init__.py19__all__ = [CODE
LOWtorchtitan/experiments/rl/actors/generator.py69logger = logging.getLogger(__name__)CODE
51 more matches not shown…
Docstring Block Structure18 hits · 90 pts
SeverityFileLineSnippetContext
HIGH…h_trace_compaction/scripts/compact_cuda_graph_trace.py182Extract measured GPU slices that have a profiler stream. Args: events: Trace event list. Returns: STRING
HIGH…h_trace_compaction/scripts/compact_cuda_graph_trace.py463Verify slice identity and non-overlap of every compacted lane. Args: original_events: Unmodified trace evenSTRING
HIGH…h_trace_compaction/scripts/compact_cuda_graph_trace.py747Remap GPU flows and annotations, and replace old stream metadata. Args: events: Events whose measured sliceSTRING
HIGH…h_trace_compaction/scripts/compact_cuda_graph_trace.py806Compact CUDA graph streams in a parsed PyTorch profiler trace. Args: trace: Parsed profiler trace. RetSTRING
HIGHtorchtitan/distributed/utils.py580 Clip the gradient norm of an iterable of parameters. Gradient norm clipping requires computing the gradient noSTRING
HIGHtorchtitan/distributed/parallel_dims.py337Get a device mesh by dimension name(s), returning None if not enabled. Args: dims: Names of the mesSTRING
HIGHtorchtitan/distributed/parallel_dims.py400Get a device mesh by dimension name(s), raising if not available. Args: dims: Names of the mesh dimSTRING
HIGHtorchtitan/distributed/pipeline_parallel.py580Create pipeline stages based on specified module names for each stage. Also used by Graph PP to split the model intSTRING
HIGHtorchtitan/distributed/context_parallel/api.py133 Shard inputs and attention masks across the context parallel mesh. This function distributes input tensors acrSTRING
HIGH…/experiments/transformers_modeling_backend/pipeline.py156 This API creates pipeline stages based on specified module names for each stage. Some model restrictions incluSTRING
HIGH…itan/experiments/graph_trainer/graph_pp/split_di_dw.py156Split a backward graph into input-gradient and weight-gradient graphs. Contract: Input: backward(saveSTRING
HIGHtorchtitan/experiments/graph_trainer/graph_pp/runner.py714Register GraphPP action handlers on a runtime PP schedule. Args: schedule (_PipelineScheduleRuntime): RuntiSTRING
HIGH…htitan/experiments/graph_trainer/graph_pp/partition.py445Partition 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.py95Split forward FSDP all-gather chains from a forward graph. Contract: unshard(param_shards_and_replicated_paraSTRING
HIGH…ments/graph_trainer/graph_pp/split_fsdp_collectives.py251Split backward FSDP/DDP/HSDP reduce-grad epilogues. Contract: bw_no_fsdp(original_backward_inputs) ->STRING
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.py19 This API creates fragments based on specified module names for each fragment. This method updates the model in STRING
HIGHtorchtitan/models/common/multimodal.py43Locate each visual item's placeholder run in the token sequence. Args: tokens: ``(T,)`` token IDs. STRING
Self-Referential Comments26 hits · 84 pts
SeverityFileLineSnippetContext
MEDIUMtests/unit_tests/cpu/test_set_determinism.py46 # Create a world_mesh mockCOMMENT
MEDIUMtests/unit_tests/cpu/test_lr_scheduler.py27 # Create a simple model with parametersCOMMENT
MEDIUMtests/unit_tests/cpu/test_lr_scheduler.py29 # Create an optimizerCOMMENT
MEDIUMtests/unit_tests/cpu/test_lr_scheduler.py36 # Create an optimizer containerCOMMENT
MEDIUMtests/unit_tests/cpu/test_lr_scheduler.py49 # Create a trainer config with the specified parametersCOMMENT
MEDIUMtests/unit_tests/cpu/test_lr_scheduler.py86 # Create a job config with 10 steps, 2 warmup steps, and linear decayCOMMENT
MEDIUMtests/unit_tests/cpu/test_lr_scheduler.py129 # Create a job config with 10 steps, 2 warmup steps, 3 stable steps, and 5 decay stepsCOMMENT
MEDIUMtests/unit_tests/cpu/test_lr_scheduler.py171 # Create a job config with a minimum learning rateCOMMENT
MEDIUMtests/unit_tests/cpu/test_lr_scheduler.py195 # Create a job config where warmup steps > training stepsCOMMENT
MEDIUMtests/unit_tests/cpu/test_lr_scheduler.py232 # Create a job config with 10 steps, 2 warmup steps, and no decay phaseCOMMENT
MEDIUMtests/unit_tests/cpu/test_lr_scheduler.py274 # Create a job config where warmup + decay steps > training stepsCOMMENT
MEDIUMtests/unit_tests/cpu/test_checkpoint.py772 # 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
MEDIUMscripts/loss_compare.py350 # Create the output folderCOMMENT
MEDIUMscripts/loss_compare.py845 # 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.py489 # Create a set of modules to keep for faster lookupCOMMENT
MEDIUM…/experiments/transformers_modeling_backend/pipeline.py196 # Create a set of modules to keep for faster lookupCOMMENT
MEDIUM…chtitan/experiments/graph_trainer/tests/test_passes.py389 # 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.py199 # Create the outer optimizer based on the inner optimizer parameters.COMMENT
MEDIUMtorchtitan/experiments/torchft/diloco/utils.py48 # Create a set of modules to keep for faster lookupCOMMENT
MEDIUMtorchtitan/experiments/rl/environment/token.py226 # Create a new list to avoid mutating previous statesCOMMENT
MEDIUMtorchtitan/models/common/moe.py184 """This class implements token-choice routing. In token-choice top-K routing, each token isSTRING
Excessive Try-Catch Wrapping58 hits · 70 pts
SeverityFileLineSnippetContext
LOWtests/unit_tests/cpu/test_tp_kv_heads_validation.py38except Exception:CODE
LOWtests/unit_tests/cpu/test_tokenizer.py376 except Exception as e:CODE
LOWtests/unit_tests/cpu/test_tokenizer.py385 except Exception as e:CODE
LOWtests/unit_tests/cpu/test_checkpoint.py957 except Exception as e:CODE
LOWtests/integration_tests/run_tests.py456 except Exception as e:CODE
LOWtests/integration_tests/run_tests.py468 except Exception as e:CODE
MEDIUMscripts/loss_compare.py325 log_print(f"Error: Import file does not exist: {import_result}")CODE
MEDIUMscripts/loss_compare.py346 log_print(f"Error: Output folder '{output_folder}' already exists")CODE
MEDIUMscripts/loss_compare.py834 log_print(f"Error: No {metric_name} values found in baseline")CODE
MEDIUMscripts/loss_compare.py838 log_print(f"Error: No {metric_name} values found in test")CODE
MEDIUMscripts/loss_compare.py842 log_print(f"Error: No {metric_name} values found in import file")CODE
MEDIUMscripts/loss_compare.py290 log_print("Error: All settings are identical")CODE
MEDIUMscripts/loss_compare.py303 log_print(f"Error: --steps must be a positive integer, got: {steps}")CODE
MEDIUMscripts/loss_compare.py308 log_print("Error: --import-result requires --assert-equal")CODE
MEDIUMscripts/loss_compare.py788 log_print("Error: baseline-only mode requires --import-result")CODE
MEDIUMscripts/loss_compare.py799 log_print(f"Error: metric '{name}' missing from {other_name} results")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
LOW…tan/experiments/transformers_modeling_backend/model.py741 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.py64 except Exception:CODE
LOWtorchtitan/experiments/graph_trainer/ep_pass_utils.py218 except Exception:CODE
LOWtorchtitan/experiments/graph_trainer/cpu_offload.py167 except Exception:CODE
LOWtorchtitan/experiments/graph_trainer/cpu_offload.py179 except Exception:CODE
LOW…eriments/graph_trainer/log_activation_memory_policy.py73 except Exception:CODE
LOWtorchtitan/experiments/graph_trainer/graph_pp/utils.py221 except Exception as exc:CODE
LOWtorchtitan/experiments/graph_trainer/graph_pp/utils.py241 except Exception as exc:CODE
LOWtorchtitan/experiments/forge/example_train.py457 except Exception:CODE
LOWtorchtitan/experiments/rl/controller.py453 except Exception:CODE
LOWtorchtitan/experiments/rl/controller.py458 except Exception:CODE
LOWtorchtitan/experiments/rl/controller.py476 except Exception:CODE
LOWtorchtitan/experiments/rl/controller.py481 except Exception:CODE
LOWtorchtitan/experiments/rl/controller.py487 except Exception:CODE
LOWtorchtitan/experiments/rl/controller.py984 except Exception:CODE
LOW…/experiments/rl/observability/vllm_otel_stat_logger.py269 except Exception as e:CODE
LOW…/experiments/rl/observability/vllm_otel_stat_logger.py374 except Exception as e:CODE
LOW…itan/experiments/rl/observability/metrics/processor.py212 except Exception:CODE
LOW…itan/experiments/rl/observability/metrics/processor.py223 except Exception:CODE
LOWtorchtitan/experiments/rl/rollout/rollouter.py435 except Exception:CODE
LOWtorchtitan/experiments/rl/examples/search_r1/env.py90 except Exception as exc:CODE
LOWtorchtitan/experiments/rl/actors/generator.py1218 except Exception as exc:CODE
LOWtorchtitan/experiments/rl/actors/generator.py1412 except Exception:CODE
MEDIUMtorchtitan/experiments/rl/scripts/loss_compare.py293 log_print("Error: no losses found in TensorBoard events")CODE
LOWtorchtitan/experiments/rl/environment/token.py165 except Exception:CODE
LOWtorchtitan/observability/structured_logger/README.md147 except Exception:CODE
LOWtorchtitan/components/metrics.py438 except Exception as e:CODE
LOWtorchtitan/components/data/loader.py173 except Exception:CODE
LOWtorchtitan/components/checkpointer/base.py58 except Exception as error:CODE
LOWtorchtitan/hf_datasets/multimodal/utils/video.py93 except Exception as e:CODE
LOWtorchtitan/hf_datasets/multimodal/utils/image.py275 except Exception as e:CODE
Over-Commented Block58 hits · 58 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
LOW…skills/numerics_debugging/scripts/activation_tracer.py81 on ``input_hashes`` / ``output_hash`` for comparison.COMMENT
LOW…skills/numerics_debugging/scripts/activation_tracer.py201 # IndexingCOMMENT
LOW…skills/numerics_debugging/scripts/activation_tracer.py561 record_ids=True,COMMENT
LOW…skills/numerics_debugging/scripts/activation_tracer.py641 # through to the metadata block below.COMMENT
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/workflows/set-matrix.yaml81 # Temporarily disable ROCm CI while the ROCm jobs are red.COMMENT
LOW.github/workflows/set-matrix.yaml101 # "index-url": "https://download.pytorch.org/whl/nightly/rocm7.2",COMMENT
LOW.github/scripts/run_8xgpu_integration_tests.sh1#!/bin/bashCOMMENT
LOWtorchtitan_recipes/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan/tools/utils.py201 # data from https://www.amd.com/en/products/accelerators/instinct/mi200/mi250x.html (per GCD)COMMENT
LOWtorchtitan/distributed/linear.py161 # AG(X_k.T) @ dY produces dW.T. This mirrors the usual AG-linear wgradCOMMENT
LOWtorchtitan/distributed/deepep/deepep.py81# ElasticBuffer.dispatch/combine are not autograd-aware. We wrap them inCOMMENT
LOWtorchtitan/config/manager.py281 )COMMENT
LOW…tan/experiments/transformers_modeling_backend/model.py741 except Exception as e:COMMENT
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
LOW…s/transformers_modeling_backend/tests/run_moe_tests.sh1#!/bin/bashCOMMENT
LOWtorchtitan/experiments/graph_trainer/make_fx_tracer.py481 # 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/inductor_passes.py201 raise ValueError(COMMENT
LOWtorchtitan/experiments/graph_trainer/tests/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOW…n/experiments/graph_trainer/tests/integration_tests.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOW…n/experiments/graph_trainer/tests/integration_tests.py721COMMENT
LOWtorchtitan/experiments/torchft/tests/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan/experiments/rl/controller.py641 )COMMENT
LOWtorchtitan/experiments/rl/tests/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan/experiments/rl/tests/integration_tests.py121 ),COMMENT
LOWtorchtitan/experiments/rl/models/attention.py141 # absent). Re-read live per-layer metadata + kv_cache from the forward contextCOMMENT
LOWtorchtitan/experiments/rl/models/vllm_wrapper.py381 )COMMENT
LOWtorchtitan/experiments/rl/observability/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan/experiments/rl/components/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan/experiments/rl/examples/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan/experiments/rl/actors/generator.py1341 # state_dict() returns hook-produced copies for fused modules (e.g.COMMENT
LOWtorchtitan/experiments/rl/scripts/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan/models/kimi_k2_7/config_registry.py521 # Fail during config parsing, before TP/FSDP creates _StridedShardCOMMENT
LOWtorchtitan/models/flux/model/model.py81 # Correction 1: DoubleStreamBlocks have symmetric img/txt streams;COMMENT
LOWtorchtitan/models/common/attention.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan/models/muse_glimmer/model.py441 with multimodal_context():COMMENT
LOWtorchtitan/observability/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan/components/optimizer/lr_scheduler.py221COMMENT
LOWtorchtitan/components/quantization/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan/components/quantization/nvfp4.py161 self,COMMENT
LOWtorchtitan/hf_datasets/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan/hf_datasets/multimodal/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtorchtitan/ops/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
Fake / Example Data56 hits · 51 pts
SeverityFileLineSnippetContext
LOWtorchtitan/experiments/graph_trainer/fsdp_passes.py91 for placeholder in gm.graph.find_nodes(op="placeholder"):CODE
LOWtorchtitan/experiments/graph_trainer/fsdp_passes.py130 if n.all_input_nodes[0].op == "placeholder":CODE
LOWtorchtitan/experiments/graph_trainer/fsdp_passes.py1120 if n in visited or n.op in ("placeholder", "get_attr"):CODE
LOWtorchtitan/experiments/graph_trainer/ep_pass_utils.py312 or node.op != "placeholder"CODE
LOWtorchtitan/experiments/graph_trainer/ep_pass_utils.py329 if node.op != "placeholder" or (val := tensor_meta(node)) is None:CODE
LOWtorchtitan/experiments/graph_trainer/memory_policy.py70 for node in gm.graph.find_nodes(op="placeholder"):CODE
LOWtorchtitan/experiments/graph_trainer/inductor_passes.py64 if node.op == "placeholder" and "val" in node.meta:CODE
LOWtorchtitan/experiments/graph_trainer/inductor_passes.py80 if node.op == "placeholder":CODE
LOWtorchtitan/experiments/graph_trainer/inductor_passes.py101 original_placeholders = list(gm.graph.find_nodes(op="placeholder"))CODE
LOWtorchtitan/experiments/graph_trainer/inductor_passes.py110 if node.op == "placeholder":CODE
LOWtorchtitan/experiments/graph_trainer/inductor_passes.py383 if node.op in ("placeholder", "output"):CODE
LOWtorchtitan/experiments/graph_trainer/ep_chunk_pass.py573 if node.op != "placeholder":CODE
LOWtorchtitan/experiments/graph_trainer/ep_chunk_pass.py2315 for idx, node in enumerate(n for n in gm.graph.nodes if n.op == "placeholder")CODE
LOWtorchtitan/experiments/graph_trainer/ep_overlap_pass.py81_GRAPH_BOUNDARY_OPS = {"placeholder", "get_attr"}CODE
LOWtorchtitan/experiments/graph_trainer/debug_utils.py34 if node.op == "placeholder":CODE
LOW…n/experiments/graph_trainer/tests/test_trace_module.py89 if node.op != "placeholder":CODE
LOW…n/experiments/graph_trainer/tests/test_trace_module.py172 if node.op == "placeholder"CODE
LOW…n/experiments/graph_trainer/tests/test_trace_module.py427 if node.op == "placeholder"CODE
LOW…n/experiments/graph_trainer/tests/test_trace_module.py451 if node.op == "placeholder"CODE
LOW…n/experiments/graph_trainer/tests/test_trace_module.py472 if node.op == "placeholder"CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py2132 self.assertEqual(node.args[0].op, "placeholder")CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py5481 if node.op == "placeholder":CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py5588 if node.op == "placeholder":CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py5607 self.assertEqual(node.args[0].op, "placeholder")CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py5685 self.assertEqual(relu_node.args[0].op, "placeholder")CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py5784 if node.op == "placeholder":CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py5884 if node.op == "placeholder":CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py5925 if node.op == "placeholder":CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py6255 node.target for node in compile_gm.graph.find_nodes(op="placeholder")CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py6258 node.meta for node in compile_gm.graph.find_nodes(op="placeholder")CODE
LOW…chtitan/experiments/graph_trainer/tests/test_passes.py6295 node.target for node in wrapped.graph.find_nodes(op="placeholder")CODE
LOW…xperiments/graph_trainer/tests/test_graph_pp_runner.py479 for node in gm.graph.find_nodes(op="placeholder"):CODE
LOW…xperiments/graph_trainer/tests/test_graph_pp_runner.py636 bw_gm.graph.find_nodes(op="placeholder")[0].meta["val"] = bw_fakeCODE
LOW…xperiments/graph_trainer/tests/test_graph_pp_runner.py637 fw_gm.graph.find_nodes(op="placeholder")[0].meta["val"] = fw_fakeCODE
LOW…xperiments/graph_trainer/tests/test_graph_pp_runner.py652 placeholders = multiplexed.graph.find_nodes(op="placeholder")CODE
LOW…xperiments/graph_trainer/tests/test_graph_pp_runner.py696 fw_gm.graph.find_nodes(op="placeholder")[0].meta["val"] = fw_fakeCODE
LOW…xperiments/graph_trainer/tests/test_graph_pp_passes.py659 sharded_param = gm.graph.find_nodes(op="placeholder")[0]CODE
LOW…xperiments/graph_trainer/tests/test_graph_pp_passes.py534 return tuple(node.name for node in gm.graph.find_nodes(op="placeholder"))CODE
LOW…itan/experiments/graph_trainer/graph_pp/split_di_dw.py200 for placeholder in list(bw_gm.graph.find_nodes(op="placeholder")):CODE
LOW…itan/experiments/graph_trainer/graph_pp/split_di_dw.py215 placeholders = list(bw_gm.graph.find_nodes(op="placeholder"))CODE
LOW…htitan/experiments/graph_trainer/graph_pp/partition.py197 for node in gm.graph.find_nodes(op="placeholder"):CODE
LOW…htitan/experiments/graph_trainer/graph_pp/partition.py320 if mutated_base.op != "placeholder" and mutated_base in backward_nodes:CODE
LOW…htitan/experiments/graph_trainer/graph_pp/partition.py348 and node.op == "placeholder"CODE
LOW…htitan/experiments/graph_trainer/graph_pp/partition.py475 placeholders = list(joint.graph.find_nodes(op="placeholder"))CODE
LOWtorchtitan/experiments/graph_trainer/graph_pp/utils.py289 return tuple(node.name for node in gm.graph.find_nodes(op="placeholder"))CODE
LOWtorchtitan/experiments/graph_trainer/graph_pp/utils.py322 return {node for node in node_closure(values) if node.op == "placeholder"}CODE
LOWtorchtitan/experiments/graph_trainer/graph_pp/utils.py386 if node.op != "placeholder":CODE
LOWtorchtitan/experiments/graph_trainer/graph_pp/utils.py399 for node in gm.graph.find_nodes(op="placeholder"):CODE
LOW…an/experiments/graph_trainer/graph_pp/graph_builder.py384 placeholders = self.modules.fw.graph.find_nodes(op="placeholder")CODE
LOW…an/experiments/graph_trainer/graph_pp/graph_builder.py750 if node.op == "placeholder":CODE
LOW…ments/graph_trainer/graph_pp/split_fsdp_collectives.py132 placeholders = graph.find_nodes(op="placeholder")CODE
LOW…ments/graph_trainer/graph_pp/split_fsdp_collectives.py288 placeholders = graph.find_nodes(op="placeholder")CODE
LOW…/experiments/graph_trainer/graph_pp/graph_multiplex.py104 fw_placeholders = multiplexed_gm.graph.find_nodes(op="placeholder")CODE
LOW…/experiments/graph_trainer/graph_pp/graph_multiplex.py109 for node in bw_gm.graph.find_nodes(op="placeholder"):CODE
LOW…/experiments/graph_trainer/graph_pp/graph_multiplex.py121 (node for node in multiplexed_gm.graph.nodes if node.op != "placeholder"),CODE
LOW…/experiments/graph_trainer/graph_pp/graph_multiplex.py128 bw_nodes = dropwhile(lambda node: node.op == "placeholder", bw_nodes)CODE
Cross-Language Confusion6 hits · 29 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.py482 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
Redundant / Tautological Comments18 hits · 24 pts
SeverityFileLineSnippetContext
LOWrun_train.sh19# Set RANK to simulate a nonzero global rank, for example RANK=16.COMMENT
LOWtests/unit_tests/cpu/test_checkpoint.py113 # Check if this is async_with_pinned_mem mode by looking for async_stager parameterCOMMENT
LOWtests/unit_tests/cpu/test_checkpoint.py713 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
LOWscripts/loss_compare.py344 # Check if output folder already existsCOMMENT
LOWscripts/loss_compare.py760 # Check if losses were extracted successfullyCOMMENT
LOWscripts/loss_compare.py1241 # Check if git working directory is clean before switching commitsCOMMENT
LOWtorchtitan/config/manager.py221 # Check if we are using tokenizer.model, if so then we need to alert users to redownload the tokenizerCOMMENT
LOW…chtitan/experiments/torchft/tests/integration_tests.py105 # Check if we have enough GPUsCOMMENT
LOWtorchtitan/experiments/rl/generate.py246 # Print resultsCOMMENT
LOWtorchtitan/experiments/rl/actors/generator.py1106 # Add the request to the queue; the engine loop will admit + process it.COMMENT
LOWtorchtitan/experiments/rl/actors/trainer.py275 # Check if the requested context exceeds the model context length.COMMENT
LOWtorchtitan/models/flux/validate.py147 # Set model to eval modeCOMMENT
LOWtorchtitan/models/flux/model/state_dict_adapter.py38 # Check if safetensors index file existsCOMMENT
LOWtorchtitan/components/metrics.py219 # Check if the loss-visible rank is included in LOG_RANK environment variableCOMMENT
LOWtorchtitan/components/metrics.py390 # Check if any logging backend is enabledCOMMENT
LOWtorchtitan/components/loss.py602 # Check if it's training model or validation modeCOMMENT
LOWtorchtitan/components/validate.py148 # Set model to eval modeCOMMENT
AI Slop Vocabulary6 hits · 18 pts
SeverityFileLineSnippetContext
MEDIUMtests/unit_tests/gpu/test_helion_rope.py31# 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/rl/routing/strategies.py189 # easy to implement, but not robust for all scenarios. Revisit with anCOMMENT
MEDIUMtorchtitan/experiments/rl/routing/strategies.py190 # more robust approach.COMMENT
MEDIUMtorchtitan/components/tokenizer.py371 # Process added_tokens_decoder (comprehensive special token definitions)COMMENT
Cross-File Repetition3 hits · 15 pts
SeverityFileLineSnippetContext
HIGH…htitan/experiments/graph_trainer/llama3/parallelize.py0token count {training.num_tokens_per_microbatch_per_dp_rank} must be divisible by the product of tp degree ({parallel_diSTRING
HIGH…chtitan/experiments/graph_trainer/qwen3/parallelize.py0token count {training.num_tokens_per_microbatch_per_dp_rank} must be divisible by the product of tp degree ({parallel_diSTRING
HIGH…n/experiments/graph_trainer/deepseek_v3/parallelize.py0token count {training.num_tokens_per_microbatch_per_dp_rank} must be divisible by the product of tp degree ({parallel_diSTRING
AI Structural Patterns13 hits · 12 pts
SeverityFileLineSnippetContext
LOWtests/unit_tests/gpu/test_qwen3_5_deltanet.py217CODE
LOWtorchtitan/distributed/flex_shard/dist_muon.py271CODE
LOW…periments/transformers_modeling_backend/parallelize.py232CODE
LOW…formers_modeling_backend/tests/test_moe_parallelism.py79CODE
LOW…formers_modeling_backend/tests/test_moe_parallelism.py115CODE
LOWtorchtitan/experiments/graph_trainer/simple_fsdp.py250CODE
LOW…ents/graph_trainer/tests/test_bitwise_deterministic.py185CODE
LOW…experiments/graph_trainer/tests/_trainer_test_utils.py23CODE
LOWtorchtitan/models/llama3/model.py53CODE
LOWtorchtitan/models/common/decoder.py308CODE
LOWtorchtitan/models/muse_glimmer/__init__.py267CODE
LOWtorchtitan/models/muse_glimmer/model.py190CODE
LOWtorchtitan/hf_datasets/multimodal/utils/image.py200CODE
Modern AI Meta-Vocabulary1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMtorchtitan/experiments/rl/examples/search_r1/README.md1# Search-R1: multi-turn retrieval-augmented GRPOCOMMENT
AI Response Leakage1 hit · 2 pts
SeverityFileLineSnippetContext
HIGHtorchtitan/experiments/rl/actors/generator.py674 # The loop now executes the decision. In this example: STEP.STRING
Example Usage Blocks1 hit · 2 pts
SeverityFileLineSnippetContext
LOW…s/transformers_modeling_backend/tests/run_moe_tests.sh4# Usage:COMMENT