AI Slop Code RIsk Monitor

InternLM/xtuner

A Next-Generation Training Engine Built for Ultra-Large MoE Models

13.7 Moderate pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for InternLM/xtuner, a Python project with 5,206 GitHub stars. SynthScan examined 355,777 lines of code across 1636 source files, recording 3429 pattern matches distributed across 24 syntactic categories. The legacy adjusted pattern signal is 13.7 (Moderate 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.

13.7
Adjusted Signal
13.7
Raw Pattern Score
100%
Time Factor
2026-10-10
Last Push
5.2K
Stars
Python
Language
355.8K
Lines of Code
1.6K
Files
3.4K
Pattern Hits
2026-10-12
Scan Date
0.16
HC Hit Rate

Risk Review · v3

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

Cognitive Ownership Risk 23.3/100 · LOW

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

Hallucinated Dependency & Supply Chain Risk 13.9/100 · LOW

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

Agent Over-Engineering Ratio 36.9/100 · MEDIUM

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

PR Review Velocity Impact 51.4/100 · HIGH

Which changes need focused human review? 3429 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 2HIGH 255MEDIUM 207LOW 2965

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 3429 distinct pattern matches across 24 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 Identifiers1251 hits · 1248 pts
SeverityFileLineSnippetContext
LOWrecipe/trace/viewer/server.py47def normalize_jaeger_query_url(jaeger_query_url: str | None) -> str | None:CODE
LOWrecipe/trace/viewer/server.py125def fetch_rollout_view_payload_from_trace_jsonl(CODE
LOWrecipe/trace/viewer/server.py150def start_rollout_trace_viewer(CODE
LOWrecipe/trace/viewer/render.py10def render_rollout_trace_html(CODE
LOWrecipe/trace/viewer/payload.py36def build_rollout_view_payload_from_jaeger_traces(CODE
LOWrecipe/trace/viewer/payload.py174def load_jaeger_traces_from_otel_jsonl(trace_jsonl_path: Path | str) -> list[dict[str, Any]]:CODE
LOWrecipe/trace/viewer/payload.py261def _jaeger_traces_from_json_record(record: dict[str, Any], *, context: str) -> list[dict[str, Any]] | None:CODE
LOWrecipe/trace/viewer/payload.py289def _otel_span_to_jaeger_span(CODE
LOWrecipe/trace/viewer/payload.py356def _otel_any_value_to_python(value: Any) -> Any:CODE
LOWrecipe/trace/viewer/payload.py420def _has_finished_sample_root_span(spans: list[dict[str, Any]]) -> bool:CODE
LOWrecipe/trace/viewer/payload.py457def _running_display_path_names(spans: list[dict[str, Any]]) -> list[str]:CODE
LOWrecipe/trace/viewer/payload.py537def filter_rollout_view_payload_by_train_step(payload: dict[str, Any], train_step: Any = "latest") -> dict[str, Any]:CODE
LOWrecipe/trace/viewer/payload.py587def _build_stage_duration_summaries(samples: list[dict[str, Any]]) -> list[dict[str, Any]]:CODE
LOWrecipe/trace/viewer/payload.py650def _summarize_raw_span_durations(raw_durations: dict[str, list[float]]) -> list[dict[str, Any]]:CODE
LOWrecipe/trace/viewer/payload.py703def _apply_sample_reward_filter(sample: dict[str, Any]) -> None:CODE
LOWrecipe/trace/viewer/payload.py796def _stage_from_span_name_and_attributes(span_name: str, attributes: dict[str, Any] | None = None) -> str:CODE
LOWrecipe/trace/viewer/payload.py958def _normalize_jaeger_query_url(jaeger_query_url: str | None) -> str | None:CODE
LOW…erl_agent/sandbox_example/test_verl_tool_agent_loop.py208 def _setup_sandbox_and_verl_config(self):CODE
LOW…erl_agent/sandbox_example/test_verl_tool_agent_loop.py240 async def test_verl_tool_agent_loop(self):CODE
LOW…erl_agent/sandbox_example/test_verl_tool_agent_loop.py313 async def test_verl_tool_agent_loop_manager(self):CODE
LOW…n_policy_distillation/build_teacher_server_commands.py41def build_teacher_launch_server_commands(CODE
LOW…n_policy_distillation/build_teacher_server_commands.py153def _allocate_teacher_devices(CODE
LOW…n_policy_distillation/build_teacher_server_commands.py255def _allocate_teacher_server_port(CODE
LOW…n_policy_distillation/build_teacher_server_commands.py274def _get_teacher_server_paths(CODE
LOWtests/conftest.py26def _is_hf_dynamic_module_root(path: str) -> bool:CODE
LOWtests/conftest.py34def _cleanup_hf_dynamic_modules() -> None:CODE
LOWtests/loss/test_ce_loss.py38 def test_global_loss_reduction(self, loss_mode, grad_accumulation_steps, chunk_size, atol, rtol):CODE
LOWtests/loss/test_ce_loss.py131 def test_other_loss_reduction(self, loss_reduction, loss_mode, grad_accumulation_steps, chunk_size, atol, rtol):CODE
LOWtests/loss/test_ce_loss.py266 def test_sp_global_loss_reduction(self, loss_mode, sp_size, grad_accumulation_steps, chunk_size, atol, rtol):CODE
LOWtests/loss/test_ce_loss.py341 def test_sp_others_loss_reduction(self, loss_reduction, loss_mode, sp_size, grad_accumulation_steps, chunk_size, atoCODE
LOWtests/loss/test_aux_loss.py49 def test_grouped_router_assignments_are_counted(self):CODE
LOWtests/loss/test_aux_loss.py71 def test_rollout_assignments_are_counted(self):CODE
LOWtests/loss/test_chunk_loss.py24def test_chunk_loss_matches_reference_with_trainable_head():CODE
LOWtests/loss/test_chunk_loss.py54def test_chunk_loss_skips_weight_grad_allocation_for_detached_head():CODE
LOWtests/float8/triton_kernels/test_import.py23 def test_cpu_actor_triton_kernels_import(self):CODE
LOWtests/module/test_grouped_linear.py27 def test_grouped_gemm_switch_selects_implementation(CODE
LOWtests/module/test_dense_decoder_layer.py59 def test_batched_inputs_match_independent_forwards(self):CODE
LOWtests/module/test_rope.py33 def test_fope_init_sin_coef_same(self):CODE
LOWtests/module/attention/test_dsa_mla.py50def _tilelang_sparse_mla_available() -> bool:CODE
LOWtests/module/attention/test_dsa_mla.py64def _cudnn_dsa_sparse_mla_available() -> bool:CODE
LOWtests/module/attention/test_dsa_mla.py91def _tilelang_sparse_mla_inputs():CODE
LOWtests/module/attention/test_dsa_mla.py99def _cudnn_dsa_sparse_mla_inputs():CODE
LOWtests/module/attention/test_dsa_mla.py205 def test_torch_indexer_matches_raw_gate_reference(self):CODE
LOWtests/module/attention/test_dsa_mla.py279 def test_packed_inputs_respect_causal_boundaries_and_backward(self):CODE
LOWtests/module/attention/test_dsa_mla.py306 def test_indexer_freeze_contract(self):CODE
LOWtests/module/attention/test_dsa_mla.py316 def test_shared_layer_consumes_explicit_topk_ids(self):CODE
LOWtests/module/attention/test_dsa_mla.py339 def test_checkpoint_reuses_source_topk_storage(self):CODE
LOWtests/module/attention/test_dsa_mla.py378 def test_absorbed_attention_matches_unabsorbed_mla(self):CODE
LOWtests/module/attention/test_dsa_mla.py399 def test_compiled_attention_matches_eager(self):CODE
LOWtests/module/attention/test_dsa_mla.py424 def test_packed_attention_matches_full_sequence(self):CODE
LOWtests/module/attention/test_dsa_mla.py480 def test_tilelang_indexer_matches_torch(self):CODE
LOWtests/module/attention/test_dsa_mla.py521 def test_cudnn_local_query_global_kv_matches_full_sequence(self):CODE
LOWtests/module/attention/test_dsa_mla.py569 def test_tilelang_forward_backward_matches_torch(self):CODE
LOWtests/module/attention/test_dsa_mla.py600 def test_cudnn_forward_backward_matches_torch(self):CODE
LOWtests/module/attention/test_dsa_mla.py632 def test_compiled_cudnn_backward_matches_tilelang(self):CODE
LOWtests/module/dispatcher/test_agrs_all2all.py24 def test_dispatch_and_combine(self, dtype, device):CODE
LOW…dule/dispatcher/test_torch_all2all_shared_expert_tp.py101def _record_shared_expert_tp_stages(dispatcher: TorchAll2AllDispatcher) -> dict[str, list[str | int]]:CODE
LOW…dule/dispatcher/test_torch_all2all_shared_expert_tp.py156def _assert_shared_expert_tp_async_stages(CODE
LOWtests/module/dispatcher/test_noep.py20 def test_dispatch_and_combine(self, dtype, device):CODE
LOWtests/module/dispatcher/test_deepep.py29 def test_dispatch_and_combine(self, dtype, device, async_op):CODE
1191 more matches not shown…
Unused Imports925 hits · 858 pts
SeverityFileLineSnippetContext
LOWci/config/qwen3_5_moe_35BA3.py11CODE
LOWci/scripts/xtuner_unittest.py10CODE
LOWci/scripts/test_sft_trainer.py15CODE
LOWci/scripts/test_sft_trainer.py20CODE
LOWci/scripts/test_sft_trainer_235B.py9CODE
LOWci/scripts/test_sft_trainer_235B.py22CODE
LOWci/scripts/test_sft_trainer_235B.py23CODE
LOWci/scripts/test_sft_trainer_235B.py26CODE
LOWci/scripts/test_sft_dense_trainer.py16CODE
LOWci/scripts/test_sft_dense_trainer.py19CODE
LOWci/scripts/test_sft_trainer_intralayer.py21CODE
LOWrecipe/trace/viewer/server.py8CODE
LOWrecipe/trace/viewer/render.py3CODE
LOWrecipe/trace/viewer/payload.py8CODE
LOW…erl_agent/gsm8k_tool_example/gsm8k_tool_grpo_config.py9CODE
LOW…n_policy_distillation/build_teacher_server_commands.py17CODE
LOWtests/conftest.py15CODE
LOWtests/chat_template/test_chat_template.py1CODE
LOWtests/chat_template/test_chat_template.py7CODE
LOWtests/loss/test_oreal_loss.py1CODE
LOWtests/loss/test_oreal_loss.py4CODE
LOWtests/loss/test_oreal_loss.py4CODE
LOWtests/loss/test_oreal_loss.py4CODE
LOWtests/loss/test_oreal_loss.py5CODE
LOWtests/loss/test_oreal_loss.py5CODE
LOWtests/loss/test_oreal_loss.py5CODE
LOWtests/loss/test_oreal_loss.py5CODE
LOWtests/loss/test_oreal_loss.py11CODE
LOWtests/loss/test_oreal_loss.py11CODE
LOWtests/loss/test_grpo_loss.py1CODE
LOWtests/float8/triton_kernels/test_import.py27CODE
LOWtests/float8/triton_kernels/test_import.py27CODE
LOWtests/float8/triton_kernels/test_import.py27CODE
LOWtests/module/dispatcher/test_agrs_all2all.py1CODE
LOWtests/module/dispatcher/test_agrs_all2all.py4CODE
LOWtests/module/dispatcher/test_deepep.py1CODE
LOWtests/module/dispatcher/test_deepep.py9CODE
LOWtests/datasets/test_dataloader.py4CODE
LOWtests/datasets/test_pack_config_from_pack_infos.py12CODE
LOWtests/datasets/test_qwen35_vl_tokenize_fn.py3CODE
LOWtests/datasets/test_qwen35_vl_tokenize_fn.py4CODE
LOWtests/datasets/test_long_text_tokenize.py6CODE
LOWtests/datasets/test_long_text_tokenize.py7CODE
LOWtests/datasets/test_dataset.py1CODE
LOWtests/datasets/test_dataset.py4CODE
LOWtests/autotest/test_common_utils.py1CODE
LOWtests/utils/test_interleaved_shard.py8CODE
LOWtests/utils/test_internal_metrics.py2CODE
LOWtests/utils/test_internal_metrics.py5CODE
LOWtests/utils/test_internal_metrics.py6CODE
LOWtests/utils/test_internal_metrics.py16CODE
LOWtests/utils/test_internal_metrics.py17CODE
LOWtests/utils/test_internal_metrics.py18CODE
LOWtests/utils/test_internal_metrics.py19CODE
LOWtests/utils/test_internal_metrics.py20CODE
LOWtests/utils/test_check_health.py5CODE
LOWtests/patch/test_dcp_interleaved_planner.py15CODE
LOWtests/model/test_qwen3_vl.py2CODE
LOWtests/model/test_qwen3_vl.py17CODE
LOWtests/model/test_qwen3_dense.py6CODE
865 more matches not shown…
Cross-File Repetition129 hits · 645 pts
SeverityFileLineSnippetContext
HIGHci/scripts/test_sft_trainer.py0plot comparison curves between two sets of data. args: history_data: list of historical data points current_data: list oSTRING
HIGHci/scripts/test_sft_trainer_235B.py0plot comparison curves between two sets of data. args: history_data: list of historical data points current_data: list oSTRING
HIGHci/scripts/test_vlm_sft_trainer.py0plot comparison curves between two sets of data. args: history_data: list of historical data points current_data: list oSTRING
HIGHci/scripts/test_sft_trainer_dsv3.py0plot comparison curves between two sets of data. args: history_data: list of historical data points current_data: list oSTRING
HIGHci/scripts/test_sft_dense_trainer.py0plot comparison curves between two sets of data. args: history_data: list of historical data points current_data: list oSTRING
HIGHci/scripts/test_sft_trainer_intralayer.py0plot comparison curves between two sets of data. args: history_data: list of historical data points current_data: list oSTRING
HIGH…cipe/verl_agent/sandbox_example/sandbox_grpo_config.py0rl colocate trainer 示例配置(grpo + gsm8k)。 用法:通过环境变量传入路径后,由 cli 加载本配置并 trainer_cfg.build().fit()。 需设置: work_dir, model_pathSTRING
HIGHautotest/config/rl_qwen3p5_35B_dapo.py0rl colocate trainer 示例配置(grpo + gsm8k)。 用法:通过环境变量传入路径后,由 cli 加载本配置并 trainer_cfg.build().fit()。 需设置: work_dir, model_pathSTRING
HIGHautotest/config/rl_qwen3_gsm8k_grpo.py0rl colocate trainer 示例配置(grpo + gsm8k)。 用法:通过环境变量传入路径后,由 cli 加载本配置并 trainer_cfg.build().fit()。 需设置: work_dir, model_pathSTRING
HIGHautotest/config/rl_qwen3_vl_geometry3k_grpo.py0rl colocate trainer 示例配置(grpo + gsm8k)。 用法:通过环境变量传入路径后,由 cli 加载本配置并 trainer_cfg.build().fit()。 需设置: work_dir, model_pathSTRING
HIGHexamples/v1/config/rl_grpo_gsm8k_with_tool.py0rl colocate trainer 示例配置(grpo + gsm8k)。 用法:通过环境变量传入路径后,由 cli 加载本配置并 trainer_cfg.build().fit()。 需设置: work_dir, model_pathSTRING
HIGHexamples/v1/config/rl_grpo_gsm8k_async.py0rl colocate trainer 示例配置(grpo + gsm8k)。 用法:通过环境变量传入路径后,由 cli 加载本配置并 trainer_cfg.build().fit()。 需设置: work_dir, model_pathSTRING
HIGHexamples/v1/config/rl_grpo_geo3k_judge.py0rl colocate trainer 示例配置(grpo + gsm8k)。 用法:通过环境变量传入路径后,由 cli 加载本配置并 trainer_cfg.build().fit()。 需设置: work_dir, model_pathSTRING
HIGHexamples/v1/config/rl_grpo_gsm8k_judge.py0rl colocate trainer 示例配置(grpo + gsm8k)。 用法:通过环境变量传入路径后,由 cli 加载本配置并 trainer_cfg.build().fit()。 需设置: work_dir, model_pathSTRING
HIGHtests/ops/test_grouped_gemm_triton.py0grouped matrix multiplication (gmm) for expert models. args: x (tensor): input tensor of shape (batch_size, seq_len, dinSTRING
HIGHxtuner/v1/ops/moe/cuda/group_gemm_cutlass.py0grouped matrix multiplication (gmm) for expert models. args: x (tensor): input tensor of shape (batch_size, seq_len, dinSTRING
HIGHxtuner/v1/ops/moe/cuda/group_gemm.py0grouped matrix multiplication (gmm) for expert models. args: x (tensor): input tensor of shape (batch_size, seq_len, dinSTRING
HIGHxtuner/v1/module/attention/mla.py0applies rotary position embedding to the query and key tensors. args: q (`torch.tensor`): the query tensor. k (`torch.teSTRING
HIGH…/model/transformers_models/mixtral/modeling_mixtral.py0applies rotary position embedding to the query and key tensors. args: q (`torch.tensor`): the query tensor. k (`torch.teSTRING
HIGH…l/transformers_models/deepseek_v2/modeling_deepseek.py0applies rotary position embedding to the query and key tensors. args: q (`torch.tensor`): the query tensor. k (`torch.teSTRING
HIGHxtuner/v1/module/attention/mla.py0multi-headed attention from 'attention is all you need' paper.STRING
HIGHxtuner/v1/module/attention/mha.py0multi-headed attention from 'attention is all you need' paper.STRING
HIGH…l/transformers_models/deepseek_v2/modeling_deepseek.py0multi-headed attention from 'attention is all you need' paper.STRING
HIGHxtuner/v1/datasets/sampler.py0sets the epoch for this sampler. when :attr:`shuffle=true`, this ensures all replicas use a different random ordering foSTRING
HIGHxtuner/dataset/samplers/intern_repo.py0sets the epoch for this sampler. when :attr:`shuffle=true`, this ensures all replicas use a different random ordering foSTRING
HIGHxtuner/dataset/samplers/length_grouped.py0sets the epoch for this sampler. when :attr:`shuffle=true`, this ensures all replicas use a different random ordering foSTRING
HIGHxtuner/v1/ops/rotary_emb.py0applies rotary position embedding to the query and key tensors. args: q (`torch.tensor`): the query tensor. k (`torch.teSTRING
HIGH…erters/modeling_internlm2_reward/modeling_internlm2.py0applies rotary position embedding to the query and key tensors. args: q (`torch.tensor`): the query tensor. k (`torch.teSTRING
HIGHxtuner/model/modules/dispatch/phi3.py0applies rotary position embedding to the query and key tensors. args: q (`torch.tensor`): the query tensor. k (`torch.teSTRING
HIGHxtuner/v1/ops/rotary_emb.py0this is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). the hidden states go from (batch, num_key_vaSTRING
HIGH…erters/modeling_internlm2_reward/modeling_internlm2.py0this is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). the hidden states go from (batch, num_key_vaSTRING
HIGH…/model/transformers_models/mixtral/modeling_mixtral.py0this is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). the hidden states go from (batch, num_key_vaSTRING
HIGH…l/transformers_models/deepseek_v2/modeling_deepseek.py0this is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). the hidden states go from (batch, num_key_vaSTRING
HIGHxtuner/model/modules/dispatch/phi3.py0this is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). the hidden states go from (batch, num_key_vaSTRING
HIGHxtuner/model/modules/dispatch/internlm2.py0this is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). the hidden states go from (batch, num_key_vaSTRING
HIGHxtuner/model/modules/dispatch/yi.py0this is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). the hidden states go from (batch, num_key_vaSTRING
HIGH…erters/modeling_internlm2_reward/modeling_internlm2.py0deepseekv2 flash attention module. this module inherits from `deepseekv2attention` as the weights of the module stays unSTRING
HIGH…/model/transformers_models/mixtral/modeling_mixtral.py0deepseekv2 flash attention module. this module inherits from `deepseekv2attention` as the weights of the module stays unSTRING
HIGH…l/transformers_models/deepseek_v2/modeling_deepseek.py0deepseekv2 flash attention module. this module inherits from `deepseekv2attention` as the weights of the module stays unSTRING
HIGH…erters/modeling_internlm2_reward/modeling_internlm2.py0calls the forward method of flash attention - if the input hidden states contain at least one padding token first unpad STRING
HIGH…/model/transformers_models/mixtral/modeling_mixtral.py0calls the forward method of flash attention - if the input hidden states contain at least one padding token first unpad STRING
HIGH…l/transformers_models/deepseek_v2/modeling_deepseek.py0calls the forward method of flash attention - if the input hidden states contain at least one padding token first unpad STRING
HIGH…erters/modeling_internlm2_reward/modeling_internlm2.py0this model inherits from [`pretrainedmodel`]. check the superclass documentation for the generic methods the library impSTRING
HIGH…/model/transformers_models/mixtral/modeling_mixtral.py0this model inherits from [`pretrainedmodel`]. check the superclass documentation for the generic methods the library impSTRING
HIGH…l/transformers_models/deepseek_v2/modeling_deepseek.py0this model inherits from [`pretrainedmodel`]. check the superclass documentation for the generic methods the library impSTRING
HIGH…erters/modeling_internlm2_reward/modeling_internlm2.py0args: labels (`torch.longtensor` of shape `(batch_size, sequence_length)`, *optional*): labels for computing the masked STRING
HIGH…/model/transformers_models/mixtral/modeling_mixtral.py0args: labels (`torch.longtensor` of shape `(batch_size, sequence_length)`, *optional*): labels for computing the masked STRING
HIGH…l/transformers_models/deepseek_v2/modeling_deepseek.py0args: labels (`torch.longtensor` of shape `(batch_size, sequence_length)`, *optional*): labels for computing the masked STRING
HIGH…erters/modeling_internlm2_reward/modeling_internlm2.py0the deepseekv2 model transformer with a sequence classification head on top (linear layer). [`deepseekv2forsequenceclassSTRING
HIGH…/model/transformers_models/mixtral/modeling_mixtral.py0the deepseekv2 model transformer with a sequence classification head on top (linear layer). [`deepseekv2forsequenceclassSTRING
HIGH…l/transformers_models/deepseek_v2/modeling_deepseek.py0the deepseekv2 model transformer with a sequence classification head on top (linear layer). [`deepseekv2forsequenceclassSTRING
HIGH…erters/modeling_internlm2_reward/modeling_internlm2.py0labels (`torch.longtensor` of shape `(batch_size,)`, *optional*): labels for computing the sequence classification/regreSTRING
HIGH…/model/transformers_models/mixtral/modeling_mixtral.py0labels (`torch.longtensor` of shape `(batch_size,)`, *optional*): labels for computing the sequence classification/regreSTRING
HIGH…l/transformers_models/deepseek_v2/modeling_deepseek.py0labels (`torch.longtensor` of shape `(batch_size,)`, *optional*): labels for computing the sequence classification/regreSTRING
HIGH…b/internlm2_chat_7b_full_finetune_custom_dataset_e1.py0data format: [ { "conversation": [ { "system": "", "input": "xxx", "output": "xxx" }, { "input": "xxx", "output": "xxx" STRING
HIGH…internlm2_5_chat_7b_full_finetune_custom_dataset_e1.py0data format: [ { "conversation": [ { "system": "", "input": "xxx", "output": "xxx" }, { "input": "xxx", "output": "xxx" STRING
HIGH…/internlm2_chat_20b_full_finetune_custom_dataset_e1.py0data format: [ { "conversation": [ { "system": "", "input": "xxx", "output": "xxx" }, { "input": "xxx", "output": "xxx" STRING
HIGH…lm2_7b/internlm2_7b_full_finetune_custom_dataset_e1.py0data format: [ { "conversation": [ { "system": "", "input": "xxx", "output": "xxx" }, { "input": "xxx", "output": "xxx" STRING
HIGH…full_finetune_custom_dataset_e1_sequence_parallel_4.py0data format: [ { "conversation": [ { "system": "", "input": "xxx", "output": "xxx" }, { "input": "xxx", "output": "xxx" STRING
HIGH…2_20b/internlm2_20b_full_finetune_custom_dataset_e1.py0data format: [ { "conversation": [ { "system": "", "input": "xxx", "output": "xxx" }, { "input": "xxx", "output": "xxx" STRING
69 more matches not shown…
Decorative Section Separators148 hits · 525 pts
SeverityFileLineSnippetContext
MEDIUMtests/datasets/test_long_text_tokenize.py12# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_long_text_tokenize.py14# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/datasets/test_long_text_tokenize.py36# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/datasets/test_long_text_tokenize.py38# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/datasets/test_long_text_tokenize.py54# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/datasets/test_long_text_tokenize.py56# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/datasets/test_long_text_tokenize.py87# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/datasets/test_long_text_tokenize.py89# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_long_text_tokenize.py176# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_long_text_tokenize.py178# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/datasets/test_long_text_tokenize.py202# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/datasets/test_long_text_tokenize.py204# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_preset_sampler.py9# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_preset_sampler.py11# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_preset_sampler.py33# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_preset_sampler.py35# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/datasets/test_preset_pack_dataset.py110# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/datasets/test_preset_pack_dataset.py112# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/datasets/test_preset_pack_dataset.py385# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/datasets/test_preset_pack_dataset.py387# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/datasets/test_preset_pack_dataset.py432# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/datasets/test_preset_pack_dataset.py434# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/datasets/test_preset_pack_dataset.py457# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/datasets/test_preset_pack_dataset.py459# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/datasets/test_preset_pack_dataset.py606# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/datasets/test_preset_pack_dataset.py608# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_preset_pack_dataset.py18# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_preset_pack_dataset.py20# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_preset_pack_dataset.py79# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_preset_pack_dataset.py81# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_preset_pack_dataset.py222# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_preset_pack_dataset.py224# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_preset_pack_dataset.py356# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_preset_pack_dataset.py358# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/optim/test_muon.py333# ─── Test: single-GPU correctness ───────────────────────────────────────────COMMENT
MEDIUM⚡tests/optim/test_muon.py378 # ── Build two identical models ───────────────────────────────────────COMMENT
MEDIUM⚡tests/optim/test_muon.py385 # ── Reference path ───────────────────────────────────────────────────COMMENT
MEDIUM⚡tests/optim/test_muon.py391 # ── Production path ──────────────────────────────────────────────────COMMENT
MEDIUMtests/optim/test_muon.py36# ─── Test: Newton-Schulz functions ───────────────────────────────────────────COMMENT
MEDIUMtests/optim/test_muon.py95# ─── Model for end-to-end tests ──────────────────────────────────────────────COMMENT
MEDIUMtests/optim/test_muon.py183# ─── Reference optimizer ─────────────────────────────────────────────────────COMMENT
MEDIUMtests/optim/test_muon.py405 # ── Compare all parameters ───────────────────────────────────────────COMMENT
MEDIUMtests/optim/test_muon.py491# ─── Test: end-to-end FSDP ───────────────────────────────────────────────────COMMENT
MEDIUMtests/optim/test_muon.py526 # ── Build model on every rank, then broadcast rank-0 weights ─────────COMMENT
MEDIUMtests/optim/test_muon.py535 # ── Generate input data on rank 0 and scatter ────────────────────────COMMENT
MEDIUMtests/optim/test_muon.py546 # ── Reference: forward all samples, average loss ─────────────────────COMMENT
MEDIUMtests/optim/test_muon.py553 # ── Fully shard the test model (production path) ─────────────────────COMMENT
MEDIUMtests/optim/test_muon.py565 # ── Production Muon optimizer step ────────────────────────────────────COMMENT
MEDIUMtests/optim/test_muon.py578 # ── Compare all parameters ───────────────────────────────────────────COMMENT
MEDIUM⚡tests/profiler/test_prober.py74# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/profiler/test_prober.py76# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/profiler/test_prober.py39# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/profiler/test_prober.py41# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/profiler/test_prober.py155# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/profiler/test_prober.py157# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/profiler/test_prober.py236# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/profiler/test_prober.py238# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/profiler/test_prober.py326# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/profiler/test_prober.py328# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/profiler/test_prober.py402# ---------------------------------------------------------------------------COMMENT
88 more matches not shown…
Empty Error Handlers80 hits · 400 pts
SeverityFileLineSnippetContext
HIGHrecipe/trace/viewer/server.py346except KeyboardInterrupt:CODE
HIGHrecipe/trace/viewer/payload.py722except (TypeError, ValueError):CODE
HIGH…erl_agent/sandbox_example/test_verl_tool_agent_loop.py89except Exception:CODE
HIGH…cipe/verl_agent/sandbox_example/sandbox_grpo_config.py158except Exception:CODE
HIGHtests/datasets/test_pack_config_from_pack_infos.py35except OSError:CODE
HIGHtests/patch/test_dcp_interleaved_planner.py128except Exception:CODE
HIGHtests/patch/test_dcp_interleaved_planner.py162except Exception:CODE
HIGHtests/model/test_qwen3_tile_embedding.py100except:CODE
HIGHtests/model/test_qwen3_tile_embedding.py175except:CODE
HIGHtests/engine/test_moe_train_engine_float8.py119except Exception:CODE
HIGHtests/engine/test_moe_train_engine_float8.py198except Exception:CODE
HIGHtests/engine/test_moe_train_engine_float8.py290except Exception:CODE
HIGHtests/engine/test_moe_train_engine_float8.py390except Exception:CODE
HIGHtests/engine/test_moe_train_engine_float8.py485except Exception:CODE
HIGHtests/engine/test_dense_train_engine.py98except:CODE
HIGHtests/engine/test_dense_train_engine.py181except:CODE
HIGHtests/engine/test_moe_train_engine_deepep_expert_tp.py158except Exception:CODE
HIGHtests/engine/test_moe_train_engine_deepep_expert_tp.py227except Exception:CODE
HIGHtests/engine/test_moe_train_engine_deepep_expert_tp.py273except Exception:CODE
HIGHtests/engine/test_moe_train_engine_deepep_expert_tp.py333except Exception:CODE
HIGHtests/engine/test_moe_train_engine_tpep.py551except Exception:CODE
HIGHtests/engine/test_moe_train_engine_tpep.py622except Exception:CODE
HIGHtests/engine/test_moe_train_engine_tpep.py668except Exception:CODE
HIGHtests/engine/test_moe_train_engine_tpep.py727except Exception:CODE
HIGHtests/engine/test_moe_train_engine_tpep.py823except Exception:CODE
HIGHtests/engine/test_moe_train_engine_tpep.py871except Exception:CODE
HIGHtests/engine/test_moe_train_engine_tpep.py923except Exception:CODE
HIGHtests/engine/test_moe_train_engine_tpep.py971except Exception:CODE
HIGHtests/engine/test_moe_train_engine_tpep.py1040except Exception:CODE
HIGHtests/engine/test_moe_train_engine_tpep.py1083except Exception:CODE
HIGHtests/engine/test_moe_train_engine.py137except:CODE
HIGHtests/engine/test_moe_train_engine.py234except:CODE
HIGHtests/engine/test_moe_train_engine.py303except:CODE
HIGHtests/engine/test_moe_train_engine.py385except:CODE
HIGHtests/engine/test_moe_train_engine.py454except:CODE
HIGHtests/rl/trace_utils.py54except RuntimeError:CODE
HIGHautotest/cluster/clusterx.py214except Exception:CODE
HIGHxtuner/v1/datasets/utils.py40except OSError:CODE
HIGHxtuner/v1/datasets/mllm_tokenize_fn/qwen3_vl_utils.py20except ImportError:CODE
HIGH…ner/v1/datasets/mllm_tokenize_fn/intern_s1_vl_utils.py20except ImportError:CODE
HIGHxtuner/v1/_writer/jsonl_writer.py91except KeyboardInterrupt:CODE
HIGHxtuner/v1/optim/muon.py109except StopIteration:CODE
HIGHxtuner/v1/utils/track_rl_mem.py366except (psutil.NoSuchProcess, psutil.AccessDenied):CODE
HIGHxtuner/v1/utils/env_check.py107except (OSError, subprocess.SubprocessError):CODE
HIGHxtuner/v1/utils/rl_test_utils.py80except requests.ConnectionError:CODE
HIGHxtuner/v1/ops/__init__.py32except ImportError:CODE
HIGHxtuner/v1/ops/sparse_mla/lmdeploy_fp8_index.py230except ImportError:CODE
HIGH…r/v1/ops/moe/cuda/triton_kernels/k_grouped_gemm_TMA.py331except: # noqa: E722CODE
HIGH…oe/cuda/triton_kernels/k_grouped_gemm_TMA_triton3_4.py303except: # noqa: E722CODE
HIGH…r/v1/ops/moe/cuda/triton_kernels/m_grouped_gemm_TMA.py463except: # noqa: E722CODE
HIGH…oe/cuda/triton_kernels/m_grouped_gemm_TMA_triton3_4.py465except: # noqa: E722CODE
HIGHxtuner/v1/engine/train_engine.py516except Exception:CODE
HIGHxtuner/v1/engine/train_engine.py520except Exception:CODE
HIGHxtuner/v1/rl/trace/runtime.py341except subprocess.TimeoutExpired:CODE
HIGHxtuner/v1/rl/utils/async_utils.py29except asyncio.CancelledError:CODE
HIGHxtuner/v1/rl/utils/ray_utils.py81except ImportError:CODE
HIGHxtuner/v1/rl/agent_loop/sandbox_agent_loop/trace.py209except Exception:CODE
HIGHxtuner/v1/rl/agent_loop/sandbox_agent_loop/trace.py308except Exception:CODE
HIGHxtuner/v1/rl/rollout/worker.py493except (json.JSONDecodeError, OSError):CODE
HIGHxtuner/v1/rl/rollout/worker.py864except ValueError:CODE
20 more matches not shown…
Deep Nesting272 hits · 256 pts
SeverityFileLineSnippetContext
LOWci/scripts/xtuner_unittest.py31CODE
LOWci/scripts/check_metric.py15CODE
LOWci/scripts/check_metric.py69CODE
LOWrecipe/trace/viewer/payload.py36CODE
LOWrecipe/trace/viewer/payload.py174CODE
LOWrecipe/trace/viewer/payload.py382CODE
LOWrecipe/trace/viewer/payload.py703CODE
LOW…n_policy_distillation/build_teacher_server_commands.py41CODE
LOWtests/datasets/test_dataloader.py42CODE
LOWtests/datasets/test_pack_config_from_pack_infos.py28CODE
LOWtests/datasets/test_qwen3_vl_tokenize_fn.py94CODE
LOWtests/datasets/test_qwen3_vl_tokenize_fn.py135CODE
LOWtests/datasets/test_qwen3_vl_tokenize_fn.py194CODE
LOWtests/datasets/test_qwen3_vl_tokenize_fn.py217CODE
LOWtests/datasets/test_qwen3_vl_tokenize_fn.py283CODE
LOWtests/datasets/test_qwen3_vl_tokenize_fn.py378CODE
LOWtests/datasets/test_qwen35_vl_tokenize_fn.py63CODE
LOWtests/datasets/test_qwen35_vl_tokenize_fn.py103CODE
LOWtests/datasets/test_qwen35_vl_tokenize_fn.py153CODE
LOWtests/datasets/test_qwen35_vl_tokenize_fn.py249CODE
LOWtests/datasets/test_intern_vl_tokenize_fn.py23CODE
LOWtests/datasets/test_intern_vl_tokenize_fn.py54CODE
LOWtests/datasets/test_intern_vl_tokenize_fn.py179CODE
LOWtests/datasets/test_intern_vl_tokenize_fn.py219CODE
LOWtests/optim/test_muon.py262CODE
LOWtests/model/test_qwen3_vl.py234CODE
LOWtests/model/test_gpt_oss_moe.py175CODE
LOWtests/model/test_fsdp_model.py164CODE
LOWtests/model/test_qwen3_dense.py220CODE
LOWtests/model/test_model_init.py51CODE
LOWtests/model/test_intern_s1.py400CODE
LOWtests/model/test_qwen3_tile_embedding.py184CODE
LOWtests/model/test_qwen3_5.py354CODE
LOWtests/model/test_qwen3_moe.py289CODE
LOWtests/model/test_qwen3_moe.py362CODE
LOWtests/model/test_qwen3_moe.py518CODE
LOWtests/model/test_qwen3_5_dense.py373CODE
LOWtests/train/test_trainer.py588CODE
LOWtests/profiler/qwen35_vl_determ.py327CODE
LOWtests/engine/test_glm52_moe_train_engine.py245CODE
LOWtests/engine/test_glm52_moe_train_engine.py391CODE
LOWtests/engine/test_moe_train_engine_tpep.py387CODE
LOWtests/engine/test_moe_train_engine_tpep.py749CODE
LOWtests/rl/test_producer.py389CODE
LOWtests/rl/trace_utils.py154CODE
LOWtests/rl/test_replay_buffer.py666CODE
LOWtests/rl/test_qwen35_vl_moe_async_train_2step.py360CODE
LOWautotest/cluster/clusterx.py89CODE
LOWautotest/config/rl_qwen3p5_vl_35B_mtp_ep.py277CODE
LOWautotest/config/rl_interns2_preview_dapo.py163CODE
LOW…otest/config/rl_interns2_preview_vl_dapo_ep2_resume.py246CODE
LOWautotest/config/rl_interns2_preview_vl_dapo.py246CODE
LOWautotest/config/rl_interns2_preview_vl_grpo.py246CODE
LOWautotest/module/train.py14CODE
LOWautotest/utils/metric_report.py90CODE
LOWautotest/utils/resume_validation.py35CODE
LOWautotest/utils/common_utils.py122CODE
LOWautotest/utils/check_metric.py82CODE
LOWautotest/utils/check_metric.py96CODE
LOWautotest/utils/check_metric.py181CODE
212 more matches not shown…
Excessive Try-Catch Wrapping219 hits · 229 pts
SeverityFileLineSnippetContext
LOWci/scripts/xtuner_unittest.py103 except Exception as e:CODE
LOW…erl_agent/sandbox_example/test_verl_tool_agent_loop.py89 except Exception:CODE
LOW…cipe/verl_agent/sandbox_example/sandbox_grpo_config.py158 except Exception:CODE
LOWrecipe/verl_agent/common/agent_loop_verl_tool.py129 except Exception as e:CODE
LOWtests/datasets/test_dataset.py82 except Exception as e:CODE
LOWtests/patch/test_dcp_interleaved_planner.py128 except Exception:CODE
LOWtests/patch/test_dcp_interleaved_planner.py162 except Exception:CODE
LOWtests/ops/test_lmdeploy_fp8_index.py27 except Exception:CODE
LOWtests/ops/test_lmdeploy_fp8_index.py50 except Exception:CODE
LOWtests/ops/test_lmdeploy_fp8_index.py61 except Exception:CODE
LOWtests/engine/test_moe_train_engine_float8.py119 except Exception:CODE
LOWtests/engine/test_moe_train_engine_float8.py198 except Exception:CODE
LOWtests/engine/test_moe_train_engine_float8.py290 except Exception:CODE
LOWtests/engine/test_moe_train_engine_float8.py390 except Exception:CODE
LOWtests/engine/test_moe_train_engine_float8.py485 except Exception:CODE
LOWtests/engine/test_moe_train_engine_deepep_expert_tp.py158 except Exception:CODE
LOWtests/engine/test_moe_train_engine_deepep_expert_tp.py227 except Exception:CODE
LOWtests/engine/test_moe_train_engine_deepep_expert_tp.py273 except Exception:CODE
LOWtests/engine/test_moe_train_engine_deepep_expert_tp.py333 except Exception:CODE
LOWtests/engine/test_moe_train_engine_tpep.py551 except Exception:CODE
LOWtests/engine/test_moe_train_engine_tpep.py622 except Exception:CODE
LOWtests/engine/test_moe_train_engine_tpep.py668 except Exception:CODE
LOWtests/engine/test_moe_train_engine_tpep.py727 except Exception:CODE
LOWtests/engine/test_moe_train_engine_tpep.py823 except Exception:CODE
LOWtests/engine/test_moe_train_engine_tpep.py871 except Exception:CODE
LOWtests/engine/test_moe_train_engine_tpep.py923 except Exception:CODE
LOWtests/engine/test_moe_train_engine_tpep.py971 except Exception:CODE
LOWtests/engine/test_moe_train_engine_tpep.py1040 except Exception:CODE
LOWtests/engine/test_moe_train_engine_tpep.py1083 except Exception:CODE
LOWtests/rl/test_qwen35_vl_moe_recover_e2e.py265 except Exception as error:CODE
LOWtests/rl/test_replay_buffer.py674 except Exception as exc:CODE
LOWtests/rl/test_rl_colocate_trainer.py385 except Exception as exc:CODE
LOWtests/rl/test_trace_store.py64 except Exception as exc:CODE
LOWautotest/cluster/clusterx.py138 except Exception as e:CODE
LOWautotest/cluster/clusterx.py189 except Exception as e:CODE
LOWautotest/cluster/clusterx.py214 except Exception:CODE
LOWautotest/cluster/clusterx.py222 except Exception as e:CODE
LOWautotest/cluster/clusterx.py236 except Exception as e:CODE
LOWautotest/cluster/clusterx.py244 except Exception as e:CODE
LOWautotest/cluster/clusterx.py265 except Exception as e:CODE
LOWautotest/cluster/clusterx.py277 except Exception as e:CODE
LOWautotest/utils/run_cmd.py8 except Exception as e:CODE
MEDIUMautotest/utils/run_cmd.py5def run_cmd(command):CODE
LOW…ls/add-chat-template/scripts/audit_hf_chat_template.py95 except Exception as exc:CODE
LOW…ls/add-chat-template/scripts/audit_hf_chat_template.py126 except Exception as exc:CODE
LOW…ls/add-chat-template/scripts/audit_hf_chat_template.py141 except Exception as exc:CODE
LOWdocs/design/sep_code_demo.py771 except Exception:CODE
LOW.dev_scripts/extract_json_profile.py18 except Exception as e:CODE
LOWxtuner/entry_point.py331 except Exception as e:STRING
LOWxtuner/v1/data_proto/messages/qwen35_chat.py301 except Exception:CODE
LOWxtuner/v1/data_proto/messages/glm52_chat.py227 except Exception:CODE
LOWxtuner/v1/datasets/vlm_jsonl.py46 except Exception as e:CODE
MEDIUMxtuner/v1/datasets/vlm_jsonl.py33def __getitem__(self, item):CODE
LOWxtuner/v1/datasets/utils.py226 except Exception: # https://github.com/facebookresearch/detectron2/issues/1885CODE
LOWxtuner/v1/datasets/packing.py583 except Exception:CODE
LOW…/datasets/mllm_tokenize_fn/intern_s1_vl_tokenize_fn.py212 except Exception as e:CODE
LOW…/datasets/mllm_tokenize_fn/intern_s1_vl_tokenize_fn.py253 except Exception as e:CODE
LOW…/datasets/mllm_tokenize_fn/intern_s1_vl_tokenize_fn.py376 except Exception as e:CODE
LOWxtuner/v1/datasets/mllm_tokenize_fn/qwen3_vl_utils.py59 except Exception as e:CODE
LOWxtuner/v1/datasets/mllm_tokenize_fn/qwen3_vl_utils.py153 except Exception as e:CODE
159 more matches not shown…
Cross-Language Confusion33 hits · 185 pts
SeverityFileLineSnippetContext
HIGH⚡recipe/trace/viewer/render.py227 if (left == null && right == null) return 0;CODE
HIGH⚡recipe/trace/viewer/render.py227 if (left == null && right == null) return 0;CODE
HIGH⚡recipe/trace/viewer/render.py228 if (left == null) return 1;CODE
HIGH⚡recipe/trace/viewer/render.py229 if (right == null) return -1;CODE
HIGH⚡recipe/trace/viewer/render.py236 return Array.from(new Set(values.filter((value) => value != null))).sort(compareValues);CODE
HIGH⚡recipe/trace/viewer/render.py240 if (payload.requested_train_step !== undefined && payload.requested_train_step !== null && payload.requested_trainCODE
HIGH⚡recipe/trace/viewer/render.py243 if (payload.selected_train_step !== undefined && payload.selected_train_step !== null) {CODE
HIGH⚡recipe/trace/viewer/render.py243 if (payload.selected_train_step !== undefined && payload.selected_train_step !== null) {CODE
HIGH⚡recipe/trace/viewer/render.py360 ["Samples", data.sample_count || 0],CODE
HIGH⚡recipe/trace/viewer/render.py361 ["Groups", data.group_count || 0],CODE
HIGH⚡recipe/trace/viewer/render.py362 ["Steps", data.step_count || 0],CODE
HIGH⚡recipe/trace/viewer/render.py424 if (node.elapsed_ms !== undefined && node.elapsed_ms !== null) return formatDurationMs(node.elapsed_ms);CODE
HIGH⚡recipe/trace/viewer/render.py424 if (node.elapsed_ms !== undefined && node.elapsed_ms !== null) return formatDurationMs(node.elapsed_ms);CODE
HIGH⚡recipe/trace/viewer/render.py425 if (node.duration_ms !== undefined && node.duration_ms !== null) return formatDurationMs(node.duration_ms);CODE
HIGH⚡recipe/trace/viewer/render.py425 if (node.duration_ms !== undefined && node.duration_ms !== null) return formatDurationMs(node.duration_ms);CODE
HIGH⚡recipe/trace/viewer/render.py430 const nodes = (sample.display_path && sample.display_path.length) ? sample.display_path : fallbackDisplayPath(samCODE
HIGH⚡recipe/trace/viewer/render.py465 if (data.service_name) sourceParts.push(`service ${data.service_name}`);CODE
HIGH⚡recipe/trace/viewer/render.py466 if (data.run_id) sourceParts.push(`run ${data.run_id}`);CODE
HIGH⚡recipe/trace/viewer/render.py467 if (data.generated_at_s) sourceParts.push(`generated ${new Date(data.generated_at_s * 1000).toLocaleString()}`);CODE
HIGHrecipe/trace/viewer/render.py206 let pendingStepRequest = null;CODE
HIGHrecipe/trace/viewer/render.py324 if (fieldValue === undefined) return fields.all.includes(term.value);CODE
HIGHrecipe/trace/viewer/render.py333 return !searchTerms.length || matchesSearch(sample, searchTerms);CODE
HIGHrecipe/trace/viewer/render.py388 return `${type}${message} (${error.sample_count || 0})`;CODE
HIGHrecipe/trace/viewer/render.py411 <td>${esc(row.error_count || 0)}</td>CODE
HIGHrecipe/trace/viewer/render.py484 const selectedStep = String(step || filters.step || "latest");CODE
HIGHrecipe/trace/viewer/render.py490 const response = await fetch(url.toString(), {cache: "no-store"});CODE
HIGHrecipe/trace/viewer/render.py501 if (pendingStepRequest === request) pendingStepRequest = null;CODE
HIGHrecipe/trace/viewer/render.py506 const selectedStep = String(step || filters.step || "latest");CODE
HIGHrecipe/trace/viewer/render.py517 if (!autoRefresh || pendingStepRequest) return;CODE
HIGHrecipe/trace/viewer/render.py518 await fetchStep(filters.step || data.requested_train_step || data.selected_train_step || "latest");CODE
HIGHxtuner/v1/rl/rollout_is.py493 - mismatch_kl: Direct KL divergence estimator KL(π_rollout || π_training)STRING
HIGHxtuner/v1/rl/agent_loop/sandbox_agent_loop/hooks.py179 f'test -d "{remote_path}" && echo DIR || echo FILE',CODE
HIGHxtuner/v1/rl/agent_loop/sandbox_agent_loop/hooks.py344 "cd /tmp && tar xzf /tmp/_lagent.tar.gz && rm /tmp/_lagent.tar.gz",CODE
Modern Structural Boilerplate130 hits · 131 pts
SeverityFileLineSnippetContext
LOWci/scripts/check_metric.py12logger = logging.getLogger(__name__)CODE
LOWrecipe/trace/viewer/server.py356__all__ = [CODE
LOWrecipe/trace/viewer/render.py532__all__ = ["render_rollout_trace_html", "write_rollout_trace_html"]STRING
LOWrecipe/trace/viewer/payload.py983__all__ = [CODE
LOWtests/model/test_qwen3_vl_async_hf.py20def _set_hf_for_compose_submodules(model, hf_path: str | Path) -> None:CODE
LOWautotest/utils/check_metric.py12logger = logging.getLogger(__name__)CODE
LOWdocs/pygments_extension/__init__.py6__all__ = ['XTunerPythonLexer', 'XTunerDraculaStyle', 'XTunerEmacsStyle']CODE
LOWxtuner/registry.py4__all__ = ["BUILDER", "MAP_FUNC"]CODE
LOWxtuner/v1/data_proto/__init__.py4__all__ = [CODE
LOWxtuner/v1/data_proto/messages/__init__.py8__all__ = ["BaseMessages", "ChatMessages", "Qwen35ChatMessages", "Glm52ChatMessages"]CODE
LOWxtuner/v1/data_proto/templates/__init__.py121__all__ = ["ChatTemplate", "HybridChatTemplate"]CODE
LOWxtuner/v1/loss/__init__.py17__all__ = [CODE
LOWxtuner/v1/loss/moe_loss.py304 def _update_running(self, value: torch.Tensor) -> None:CODE
LOWxtuner/v1/config/__init__.py6__all__ = [CODE
LOWxtuner/v1/float8/__init__.py6__all__ = [CODE
LOWxtuner/v1/float8/triton_kernels/__init__.py28__all__ = [CODE
LOWxtuner/v1/module/__init__.py25__all__ = [CODE
LOWxtuner/v1/module/attention/__init__.py8__all__ = [CODE
LOWxtuner/v1/module/rms_norm/__init__.py4__all__ = ["RMSNorm"]CODE
LOWxtuner/v1/module/dispatcher/__init__.py99__all__ = [CODE
LOWxtuner/v1/module/rope/__init__.py11__all__ = [CODE
LOWxtuner/v1/module/mtp/__init__.py7__all__ = ["MTPConfig", "MTPBlock", "MTPLayer", "roll_packed_tensor", "roll_sequence_context"]CODE
LOWxtuner/v1/module/router/__init__.py6__all__ = [CODE
LOWxtuner/v1/datasets/build.py4__all__ = [CODE
LOWxtuner/v1/datasets/preset_sampler.py170 def set_epoch(self, epoch: int) -> None:CODE
LOWxtuner/v1/datasets/__init__.py38__all__ = [CODE
LOWxtuner/v1/datasets/dataloader.py121 def set_epoch(self, epoch: int) -> None:CODE
LOWxtuner/v1/datasets/sampler.py122 def set_epoch(self, epoch: int) -> None:CODE
LOWxtuner/v1/datasets/sampler.py266 def set_epoch(self, epoch: int) -> None:CODE
LOWxtuner/v1/datasets/mllm_tokenize_fn/__init__.py6__all__ = [CODE
LOWxtuner/v1/datasets/pt_tokenize_fn/__init__.py5__all__ = [CODE
LOWxtuner/v1/datasets/rl_tokenize_fn/__init__.py5__all__ = ["RLTextTokenizeFnConfig", "RLQwen3VLTokenizeFnConfig"]CODE
LOWxtuner/v1/_writer/__init__.py45__all__ = ["JsonlWriter", "TensorboardWriter"]CODE
LOWxtuner/v1/optim/__init__.py5__all__ = ["Muon", "SwapAdamW"]CODE
LOWxtuner/v1/utils/__init__.py32__all__ = [CODE
LOW⚡xtuner/v1/utils/process.py37def set_async_save_process_qos() -> None:CODE
LOW⚡xtuner/v1/utils/process.py44def set_process_qos(cpu_priority: int | None, io_priority: int | None) -> None:CODE
LOWxtuner/v1/utils/interleaved_shard.py40__all__ = [CODE
LOWxtuner/v1/patch/dcp_interleaved_planner.py55__all__ = ["InterleavedShardSavePlanner", "InterleavedShardLoadPlanner"]CODE
LOWxtuner/v1/patch/__init__.py7__all__ = [CODE
LOWxtuner/v1/patch/xtuner_storage.py25logger = logging.getLogger(__name__)CODE
LOWxtuner/v1/model/__init__.py74__all__ = [CODE
LOWxtuner/v1/model/compose/intern_s1/__init__.py13__all__ = [CODE
LOWxtuner/v1/model/compose/qwen3_5/__init__.py4__all__ = [CODE
LOWxtuner/v1/model/compose/internvl/__init__.py14__all__ = [CODE
LOWxtuner/v1/model/compose/qwen3_vl/__init__.py5__all__ = [CODE
LOWxtuner/v1/model/utils/__init__.py5__all__ = [CODE
LOWxtuner/v1/model/utils/checkpointing.py14__all__ = ["apply_activation_checkpointing", "is_checkpoint_replay", "reuse_during_recompute"]CODE
LOWxtuner/v1/model/moe/moe.py604 def _set_recv_tokens_hook(self, hook: Callable[[int], None] | None) -> None:CODE
LOWxtuner/v1/model/moe/glm52/__init__.py5__all__ = [CODE
LOWxtuner/v1/model/moe/glm52/dsa_mla.py533def _setup_absorbed_query_context(ctx, inputs, output) -> None:CODE
LOWxtuner/v1/train/__init__.py5__all__ = ["Trainer", "TrainerConfig", "UTF8ByteTokenizer", "ResumeConfig", "LoadCheckpointConfig"]CODE
LOWxtuner/v1/ops/__init__.py4__all__ = ["all_to_all_single_autograd", "ulysses_all_to_all"]CODE
LOWxtuner/v1/ops/comm/__init__.py5__all__ = [CODE
LOWxtuner/v1/ops/sparse_mla/flash_mla.py93def _setup_flash_mla_context(ctx, inputs, output) -> None:CODE
LOW⚡xtuner/v1/ops/sparse_mla/tilelang.py84def _setup_tilelang_sparse_mla_context(ctx, inputs, output) -> None:CODE
LOWxtuner/v1/ops/sparse_mla/__init__.py138__all__ = [CODE
LOWxtuner/v1/ops/sparse_mla/indexer_fp8_quant.py148__all__ = ["FP8_DTYPE", "INDEXER_HEAD_DIM", "indexer_fp8_quant"]CODE
LOWxtuner/v1/ops/sparse_mla/lmdeploy_sparse_index_topk.py201__all__ = ["is_sparse_index_topk_supported", "sparse_index_topk"]CODE
LOW⚡xtuner/v1/ops/sparse_mla/cudnn_dsa.py66def _setup_cudnn_dsa_sparse_mla_context(ctx, inputs, output) -> None:CODE
70 more matches not shown…
AI Structural Patterns98 hits · 95 pts
SeverityFileLineSnippetContext
LOWtests/rl/test_replay_buffer.py43CODE
LOWtests/rl/test_prepare_train_data.py49CODE
LOWxtuner/v1/data_proto/sequence_context.py60CODE
LOWxtuner/v1/data_proto/utils.py129CODE
LOWxtuner/v1/loss/liger_with_weights.py24CODE
LOWxtuner/v1/loss/liger_with_weights.py211CODE
LOWxtuner/v1/float8/float8_gmm_tile_wise.py369CODE
LOWxtuner/v1/module/attention/mla.py177CODE
LOWxtuner/v1/module/attention/mha.py115CODE
LOWxtuner/v1/module/dispatcher/deepep.py449CODE
LOWxtuner/v1/module/decoder_layer/moe_decoder_layer.py234CODE
LOWxtuner/v1/module/decoder_layer/moe_decoder_layer.py240CODE
LOWxtuner/v1/module/decoder_layer/dense_decoder_layer.py60CODE
LOWxtuner/v1/datasets/ftdp.py770CODE
LOWxtuner/v1/datasets/jsonl.py263CODE
LOW…/datasets/mllm_tokenize_fn/intern_s1_vl_tokenize_fn.py72CODE
LOW…/datasets/mllm_tokenize_fn/intern_s1_vl_tokenize_fn.py203CODE
LOW…/datasets/mllm_tokenize_fn/intern_s1_vl_tokenize_fn.py340CODE
LOW…/datasets/mllm_tokenize_fn/intern_s1_vl_tokenize_fn.py466CODE
LOW…/v1/datasets/mllm_tokenize_fn/base_mllm_tokenize_fn.py139CODE
LOW…r/v1/datasets/mllm_tokenize_fn/qwen3_vl_tokenize_fn.py277CODE
LOW…r/v1/datasets/mllm_tokenize_fn/qwen3_vl_tokenize_fn.py501CODE
LOW…r/v1/datasets/mllm_tokenize_fn/qwen3_vl_tokenize_fn.py653CODE
LOW…r/v1/datasets/mllm_tokenize_fn/qwen3_vl_tokenize_fn.py1049CODE
LOWxtuner/v1/datasets/pt_tokenize_fn/long_text.py28CODE
LOWxtuner/v1/optim/muon.py331CODE
LOWxtuner/v1/optim/swap_adamw.py23CODE
LOWxtuner/v1/utils/convert_gsm8k.py59CODE
LOWxtuner/v1/utils/convert_geometry3k.py81CODE
LOWxtuner/v1/utils/convert_gsm8k_with_tool.py76CODE
LOWxtuner/v1/patch/xtuner_storage.py149CODE
LOWxtuner/v1/model/base.py1283CODE
LOWxtuner/v1/model/moe/glm52/dsa_mla.py275CODE
LOWxtuner/v1/train/trainer.py528CODE
LOWxtuner/v1/ops/tensor_parallel/npu.py351CODE
LOWxtuner/v1/ops/tensor_parallel/npu.py169CODE
LOWxtuner/v1/ops/tensor_parallel/npu.py282CODE
LOWxtuner/v1/ops/tensor_parallel/cuda.py24CODE
LOWxtuner/v1/ops/rms_norm/gpu.py108CODE
LOWxtuner/v1/ops/rms_norm/gpu.py164CODE
LOWxtuner/v1/ops/rms_norm/gpu.py346CODE
LOWxtuner/v1/ops/rms_norm/gpu.py412CODE
LOWxtuner/v1/ops/rms_norm/gpu.py696CODE
LOWxtuner/v1/ops/rms_norm/gpu.py756CODE
LOWxtuner/v1/ops/rms_norm/gpu.py1046CODE
LOWxtuner/v1/ops/rms_norm/gpu.py1088CODE
LOWxtuner/v1/ops/rms_norm/gpu.py893CODE
LOWxtuner/v1/ops/comm/all_to_all.py51CODE
LOWxtuner/v1/ops/comm/sequence_parallel.py39CODE
LOWxtuner/v1/ops/gated_deltanet/chunk_gated_delta_rule.py279CODE
LOWxtuner/v1/ops/gated_deltanet/rms_norm_gated.py75CODE
LOWxtuner/v1/ops/gated_deltanet/rms_norm_gated.py109CODE
LOWxtuner/v1/ops/sparse_mla/tilelang_sparse_mla_bwd.py84CODE
LOWxtuner/v1/ops/moe/npu/group_gemm.py10CODE
LOWxtuner/v1/ops/flash_attn/protocol.py26CODE
LOWxtuner/v1/ops/flash_attn/protocol.py5CODE
LOWxtuner/v1/ops/flash_attn/npu.py5CODE
LOWxtuner/v1/ops/flash_attn/gpu.py248CODE
LOWxtuner/v1/ops/flash_attn/gpu.py292CODE
LOWxtuner/v1/ops/flash_attn/gpu.py487CODE
38 more matches not shown…
Docstring Block Structure11 hits · 55 pts
SeverityFileLineSnippetContext
HIGH…n_policy_distillation/build_teacher_server_commands.py160Allocate high-rank GPUs to local Teachers and leave the rest to Student. Teacher replicas are processed by descendiSTRING
HIGH…ner/v1/float8/triton_kernels/per_block_dequant_gemm.py38Dequantizes the given weight tensor using the provided scale tensor. Args: x (torch.Tensor): The quantized STRING
HIGHxtuner/v1/utils/misc.py106Calculate the padding length needed to make the input length divisible by divisors. Args: length: The iSTRING
HIGHxtuner/v1/model/base.py163Build a `TransformerConfig` from a pre-trained HuggingFace model. This method creates a configuration object baSTRING
HIGHxtuner/v1/train/toy_tokenizer.py114Decode a sequence of token IDs back to text. Converts byte-level token IDs back to UTF-8 text. Special tokens aSTRING
HIGHxtuner/v1/ops/gated_deltanet/chunk_gated_delta_rule.py297 Args: q (torch.Tensor): queries of shape `[B, T, H, K]`. k (torch.Tensor): STRING
HIGHxtuner/v1/rl/utils/ray_accelerator_worker.py312Determine the type of accelerator used in a PlacementGroup. Args: pg (PlacementGroup): The placemenSTRING
HIGHxtuner/v1/rl/utils/ray_accelerator_worker.py336Provide a dictionary of resource requests for Ray tasks or actors that need to be scheduled on a node with a speSTRING
HIGHxtuner/v1/rl/utils/ray_accelerator_worker.py363Get SPMD (Single Program, Multiple Data) info from the placement group. This includes the sorted bundleSTRING
HIGHxtuner/v1/rl/rollout/trace_store.py363Export the stored training trace given a complete prompt text. Args: session_id (str): The session STRING
HIGHxtuner/parallel/sequence/comm.py72Convenience function to apply the all-to-all operation with scatter and gather dimensions. Notes: We haSTRING
Modern AI Meta-Vocabulary16 hits · 42 pts
SeverityFileLineSnippetContext
MEDIUM⚡tests/model/test_qwen3_5_dense.py274 # Whole-model bitwise parity that runs the real `compose.forward` / `Dense.forward` orchestrationCOMMENT
MEDIUM⚡tests/model/test_qwen3_5_dense.py280 # layer present — it only needs the forward orchestration to run end-to-end. N=4 covers bothCOMMENT
MEDIUMtests/rl/test_prepare_train_data.py202 # plain: 2 个 mask!=0 token 计入 2.0; agentic: 2 个 label!=-100 token 计入 -1.0。COMMENT
MEDIUMxtuner/v1/data_proto/messages/glm52_chat.py134 # The opening <think> is template scaffolding. The trace and its closing tag are model-generated.COMMENT
MEDIUMxtuner/v1/train/rl_trainer.py1208 # session_id is only set by agentic loops / XTUNER_DETERMINISTIC; plain RL falls backCOMMENT
MEDIUMxtuner/v1/train/rl_trainer.py1281 # Mixed agentic/VLM batches use three-axis MRoPE position IDs. Repeat theCOMMENT
MEDIUMxtuner/v1/train/rl_trainer.py1282 # normal text positions on every axis so agentic samples have the same rankCOMMENT
MEDIUMxtuner/v1/ops/flash_attn/protocol.py17 window_size=(-1, -1), # -1 means infinite context windowCODE
MEDIUMxtuner/v1/ops/flash_attn/gpu.py29 window_size_left: int = -1, # -1 means infinite context windowCODE
MEDIUMxtuner/v1/ops/flash_attn/gpu.py82 window_size_left: int = -1, # -1 means infinite context windowCODE
MEDIUMxtuner/v1/ops/flash_attn/gpu.py111 window_size_left: int = -1, # -1 means infinite context windowCODE
MEDIUMxtuner/v1/ops/flash_attn/gpu.py158 window_size_left: int = -1, # -1 means infinite context windowCODE
MEDIUMxtuner/v1/ops/flash_attn/gpu.py303 window_size=(-1, -1), # -1 means infinite context windowCODE
MEDIUMxtuner/model/modules/dispatch/attention.py25 window_size=(-1, -1), # -1 means infinite context windowCODE
MEDIUMxtuner/model/modules/dispatch/attention.py48 window_size=(-1, -1), # -1 means infinite context windowCODE
MEDIUMxtuner/model/modules/dispatch/attention.py89 window_size=(-1, -1), # -1 means infinite context windowCODE
Self-Referential Comments13 hits · 40 pts
SeverityFileLineSnippetContext
MEDIUMtests/train/test_trainer.py78 # Create a fake model fileCOMMENT
MEDIUMtests/train/test_trainer.py81 # Create a fake config fileCOMMENT
MEDIUMtests/engine/test_moe_train_engine_float8.py471 # Create a fresh engine that has never run a training step, then callCOMMENT
MEDIUMtests/rl/test_cpu_pg.py102 # Create a receiver workerCOMMENT
MEDIUMxtuner/v1/datasets/packing.py512 # Create a single dedicated process group with a generous timeout forCOMMENT
MEDIUM…r/v1/datasets/mllm_tokenize_fn/intern_s1_vl_process.py42# Define the JPEG compression quality range, pre-create all JPEG compression functionsCOMMENT
MEDIUMxtuner/v1/optim/muon.py4# This file is developed based on and inspired by the following projects:COMMENT
MEDIUMxtuner/v1/utils/compile.py63# Create a singleton instanceCOMMENT
MEDIUMxtuner/v1/model/base.py359 # This method is for compatibility with transformers 5.x rope_utilsCOMMENT
MEDIUM⚡…er/v1/ops/flash_attn/flash_sink_varlen_attn_gpt_oss.py6# This file contains code originally written by Wenhao Li.COMMENT
MEDIUMxtuner/v1/profiler/prober_utils.py1# This file is separated from prober.py to avoid circular import.COMMENT
MEDIUM⚡xtuner/v1/rl/weight_update/transport.py652 # Create a Gloo process group for synchronization during NCCL weight update.COMMENT
MEDIUMxtuner/utils/rm_utils.py10 """This class is used to process the input sequences for the rewardSTRING
Over-Commented Block39 hits · 37 pts
SeverityFileLineSnippetContext
LOWci/config/qwen3_5_dense4B.py1# Smoke SFT config for Qwen3.5-VL Dense 4B's text tower — drives the fullCOMMENT
LOWtests/model/test_qwen3_5_dense.py261 self.assertEqual(loss_diff, 0.0, f"VL loss not bitwise-equal: {loss_diff}")COMMENT
LOWtests/rl/test_replay_buffer.py1# 当前 ReplayBuffer PR-fast 单测覆盖点:COMMENT
LOWautotest/config.yaml1801 # -COMMENT
LOWautotest/utils/check_metric.py41# Without ``aggregate``, behavior stays step-by-step drift vs baseline.COMMENT
LOWdocs/en/switch_language.md1## <a href='https://xtuner.readthedocs.io/en/latest/'>English</a>COMMENT
LOWdocs/en/pretrain_sft/tutorial/resume.md1# Automatic Resume TrainingCOMMENT
LOW.dev_scripts/debug_rl_snapshot.sh1#!/usr/bin/env bashCOMMENT
LOW.dev_scripts/debug_rl_snapshot.sh21# WORK_DIR=/path/to/ray/work_dir OUT_ROOT=/path/to/debug_output \COMMENT
LOWxtuner/__init__.py1# # Copyright (c) OpenMMLab. All rights reserved.COMMENT
LOWxtuner/__init__.py21# patch_deepspeed_engine()COMMENT
LOWxtuner/v1/loss/base_loss_ctx.py21# There are 3 steps to compute the calibrated loss:COMMENT
LOWxtuner/v1/config/fsdp.py21 # Training-time FSDP CPU offload is version-sensitive for XTuner model configsCOMMENT
LOWxtuner/v1/float8/fsdp_utils.py441 scale = scale.view(-1, 2, dim, scale.shape[-1])COMMENT
LOWxtuner/v1/float8/triton_kernels/trans_quant_per_tile.py221# m_aligned = (m + 127) // 128 * 128COMMENT
LOWxtuner/v1/module/dispatcher/deepep.py481 # thread runs well ahead of the GPU stream, and the next microbatch'sCOMMENT
LOWxtuner/v1/datasets/jsonl.py321 if not os.path.exists(_cached_file):COMMENT
LOWxtuner/v1/datasets/jsonl.py341 # "tags": {COMMENT
LOWxtuner/v1/optim/muon.py1# ================================================================COMMENT
LOWxtuner/v1/optim/muon.py721 # Newton-Schulz needs the LOCAL number of experts after EP sharding, so eachCOMMENT
LOWxtuner/v1/optim/muon.py741 #COMMENT
LOWxtuner/v1/utils/load_spec.py381 # inner to outer, so the steps are reversed; preserved shards, such as an EP shard kept local for RL weightCOMMENT
LOWxtuner/v1/model/base.py1021 initialized_params = default_init_weights(self)COMMENT
LOWxtuner/v1/model/moe/moe.py1681 # as `fsdp_mesh`. However, PyTorch's mesh management uses global logic: when aCOMMENT
LOWxtuner/v1/model/moe/glm52/dsa_mla.py421 w_kc, w_vc = torch.split(wkv_b, [self.qk_nope_head_dim, self.v_head_dim], dim=1)COMMENT
LOWxtuner/v1/train/trainer.py1981 # if model_cfg.text_config.pad_token_id != pad_token_id:COMMENT
LOWxtuner/v1/rl/rollout_is.py1# modified from https://github.com/volcengine/verl/blob/main/verl/trainer/ppo/mismatch_helper.pyCOMMENT
LOWxtuner/v1/rl/agent_loop/sandbox_agent_loop/trace.py321 fp.write(line + "\n")COMMENT
LOWxtuner/tools/llm_calc/llm_calculator.py441 # core attn的计算COMMENT
LOWxtuner/tools/llm_calc/llm_calculator.py641 print(f"Total_params_num: {self.params_num / 1024**3} B, embed_params_num: {self.embed_params_num / 1024**3} B, COMMENT
LOWxtuner/tools/llm_calc/llm_calculator.py661COMMENT
LOW…erters/modeling_internlm2_reward/modeling_internlm2.py1# Copyright (c) The InternLM team and The HuggingFace Inc. team. All rights reserved.COMMENT
LOW…s/modeling_internlm2_reward/configuration_internlm2.py1# coding=utf-8COMMENT
LOWxtuner/dataset/refcoco_json.py261 self.data["categories"] = instances["categories"]COMMENT
LOW…del/polar/POLAR_1_8B_full_varlenattn_custom_dataset.py81 type=AutoModel.from_pretrained,COMMENT
LOW…model/polar/POLAR_7B_full_varlenattn_custom_dataset.py81 type=AutoModel.from_pretrained,COMMENT
LOW…l/transformers_models/mixtral/configuration_mixtral.py1# Copyright 2023 Mixtral AI and the HuggingFace Inc. team. All rights reserved.COMMENT
LOW…l/transformers_models/deepseek_v2/modeling_deepseek.py1# Copyright 2023 DeepSeek-AI and The HuggingFace Inc. team. All rights reserved.COMMENT
LOWxtuner/engine/hooks/throughput_hook.py121 # qkv_proj + o_proj: 8B * s * h^2COMMENT
AI Slop Vocabulary15 hits · 32 pts
SeverityFileLineSnippetContext
MEDIUMxtuner/v1/module/dispatcher/torch_all2all.py34# 1. (preprocess) Sort the hidden states along the expert dimension (permute) to facilitate torch all2all, and record thCOMMENT
LOWxtuner/v1/utils/httpx_utils.py52 # For simplicity here, we'll just return the known ones or fall back.COMMENT
MEDIUMxtuner/v1/model/compose/qwen3_vl/modeling_qwen3_vl.py165 # To simplify and facilitate the processing of deepstack_visual_embeds inside language_model,COMMENT
LOWxtuner/v1/ops/gated_deltanet/causal_conv1d.py204 # Here we just pass in None and dx will be allocated in the C++ code.COMMENT
MEDIUM⚡xtuner/v1/rl/rollout_is.py274 # Step 2: Compute comprehensive metricsCOMMENT
MEDIUMxtuner/v1/rl/rollout_is.py361 """Compute comprehensive metrics for importance sampling weights.STRING
LOWxtuner/utils/zero_to_any_dtype.py206 # for non-expert parameters. So we can just use the max of theCOMMENT
MEDIUM…r/configs/minicpm/minicpm3_4b/minicpm3_4b_dpo_qlora.py37dpo_loss_type = "sigmoid" # One of ['sigmoid', 'hinge', 'ipo', 'kto_pair', 'sppo_hard', 'nca_pair', 'robust'] # noqa: CODE
MEDIUMxtuner/configs/minicpm/1_2b/minicpm_1b_dpo_qlora.py37dpo_loss_type = "sigmoid" # One of ['sigmoid', 'hinge', 'ipo', 'kto_pair', 'sppo_hard', 'nca_pair', 'robust'] # noqa: CODE
MEDIUMxtuner/configs/minicpm/2b/minicpm_2b_dpo_qlora.py37dpo_loss_type = "sigmoid" # One of ['sigmoid', 'hinge', 'ipo', 'kto_pair', 'sppo_hard', 'nca_pair', 'robust'] # noqa: CODE
MEDIUM…dpo/internlm/internlm2_chat_7b_dpo_qlora_varlenattn.py38dpo_loss_type = "sigmoid" # One of ['sigmoid', 'hinge', 'ipo', 'kto_pair', 'sppo_hard', 'nca_pair', 'robust'] # noqa: CODE
MEDIUM…r/configs/dpo/internlm/internlm2_chat_1_8b_dpo_full.py35dpo_loss_type = "sigmoid" # One of ['sigmoid', 'hinge', 'ipo', 'kto_pair', 'sppo_hard', 'nca_pair', 'robust'] # noqa: CODE
MEDIUM…po/internlm/internlm2_chat_1_8b_dpo_full_varlenattn.py36dpo_loss_type = "sigmoid" # One of ['sigmoid', 'hinge', 'ipo', 'kto_pair', 'sppo_hard', 'nca_pair', 'robust'] # noqa: CODE
MEDIUM…ternlm2_chat_1_8b_dpo_full_varlenattn_jsonl_dataset.py35dpo_loss_type = "sigmoid" # One of ['sigmoid', 'hinge', 'ipo', 'kto_pair', 'sppo_hard', 'nca_pair', 'robust'] # noqa: CODE
MEDIUM…s/dpo/llama/llama3_8b_instruct_dpo_qlora_varlenattn.py38dpo_loss_type = "sigmoid" # One of ['sigmoid', 'hinge', 'ipo', 'kto_pair', 'sppo_hard', 'nca_pair', 'robust'] # noqa: CODE
Verbosity Indicators14 hits · 24 pts
SeverityFileLineSnippetContext
LOWtests/datasets/test_preset_dataloader.py287 # Step 1: jsonlCOMMENT
LOWtests/datasets/test_preset_dataloader.py309 # Step 2: pack configCOMMENT
LOWtests/datasets/test_preset_dataloader.py344 # Step 3: sampler configCOMMENT
LOW⚡xtuner/v1/optim/muon.py805 # Step 1: resolve the FSDP-visible shard dimension for this batch's shapeCOMMENT
LOW⚡xtuner/v1/optim/muon.py815 # Step 2: gather this batch's gradients and per-parameter optimizer state.COMMENT
LOW⚡xtuner/v1/optim/muon.py824 # Step 3: pick the Newton-Schulz callback — MuonSplit parameters orthogonalizeCOMMENT
LOWxtuner/v1/optim/muon.py672 # Step 1: locate the sharded mesh dim(s) and the tensor dim(s) they shard.COMMENT
LOWxtuner/v1/optim/muon.py731 # Step 2: expert-locality optimizations — when an FSDP rank already holds completeCOMMENT
LOWxtuner/v1/optim/muon.py783 # Step 3: general case — every rank holds a shard of each matrix, so they areCOMMENT
LOWxtuner/v1/optim/muon.py837 # Step 4: re-route a remainder (or all-to-all-disabled) batch away from all_to_all,COMMENT
LOWxtuner/v1/optim/muon.py851 # Step 5: assemble the AsyncTask, which starts running immediately up to itsCOMMENT
LOWxtuner/v1/rl/rollout_is.py207 # Step 1: Compute raw importance weights based on the specified levelCOMMENT
LOW⚡xtuner/v1/rl/rollout_is.py274 # Step 2: Compute comprehensive metricsCOMMENT
LOWxtuner/v1/rl/rollout_is.py289 # Step 3: Apply outlier handling and rejection samplingCOMMENT
Structural Annotation Overuse14 hits · 23 pts
SeverityFileLineSnippetContext
LOWtests/datasets/test_preset_dataloader.py287 # Step 1: jsonlCOMMENT
LOWtests/datasets/test_preset_dataloader.py309 # Step 2: pack configCOMMENT
LOWtests/datasets/test_preset_dataloader.py344 # Step 3: sampler configCOMMENT
LOW⚡xtuner/v1/optim/muon.py805 # Step 1: resolve the FSDP-visible shard dimension for this batch's shapeCOMMENT
LOW⚡xtuner/v1/optim/muon.py815 # Step 2: gather this batch's gradients and per-parameter optimizer state.COMMENT
LOW⚡xtuner/v1/optim/muon.py824 # Step 3: pick the Newton-Schulz callback — MuonSplit parameters orthogonalizeCOMMENT
LOWxtuner/v1/optim/muon.py672 # Step 1: locate the sharded mesh dim(s) and the tensor dim(s) they shard.COMMENT
LOWxtuner/v1/optim/muon.py731 # Step 2: expert-locality optimizations — when an FSDP rank already holds completeCOMMENT
LOWxtuner/v1/optim/muon.py783 # Step 3: general case — every rank holds a shard of each matrix, so they areCOMMENT
LOWxtuner/v1/optim/muon.py837 # Step 4: re-route a remainder (or all-to-all-disabled) batch away from all_to_all,COMMENT
LOWxtuner/v1/optim/muon.py851 # Step 5: assemble the AsyncTask, which starts running immediately up to itsCOMMENT
LOWxtuner/v1/rl/rollout_is.py207 # Step 1: Compute raw importance weights based on the specified levelCOMMENT
LOW⚡xtuner/v1/rl/rollout_is.py274 # Step 2: Compute comprehensive metricsCOMMENT
LOWxtuner/v1/rl/rollout_is.py289 # Step 3: Apply outlier handling and rejection samplingCOMMENT
Hallucination Indicators2 hits · 20 pts
SeverityFileLineSnippetContext
CRITICALtests/model/test_qwen3_tile_embedding.py168 embedding_weight = engine.model.language_model.embed_tokens.weight.full_tensor().mean().item()CODE
CRITICALtests/model/test_qwen3_tile_embedding.py169 lm_head_weight = engine.model.language_model.lm_head.weight.full_tensor().mean().item()CODE
Redundant / Tautological Comments8 hits · 12 pts
SeverityFileLineSnippetContext
LOWxtuner/v1/datasets/_hardcode_patch.py94 # Check if buffer matches skip_seqCOMMENT
LOWxtuner/v1/datasets/_hardcode_patch.py100 # Check if buffer is still a valid prefixCOMMENT
LOWxtuner/v1/datasets/_hardcode_patch.py117 # Check if current token starts a new potential matchCOMMENT
LOWxtuner/v1/datasets/_hardcode_patch.py128 # Check if the remaining buffer is exactly <think></think>COMMENT
LOWxtuner/v1/optim/muon.py475 # Increment stepCOMMENT
LOWxtuner/v1/utils/test_utils.py28 # Check if the shapes of the tensors matchCOMMENT
LOWxtuner/v1/utils/test_utils.py60 # Check if all elements are closeCOMMENT
LOWxtuner/v1/rl/rollout_is.py256 # Check if any token ratio is below veto threshold (in log space)COMMENT
Synthetic Comment Markers2 hits · 10 pts
SeverityFileLineSnippetContext
HIGH.claude/CLAUDE.md614. **Never** include metadata or watermarks unrelated to the code itself, such as "generated by AI" or "Co-Authored-By: CODE
HIGH.codex/AGENTS.md614. **Never** include metadata or watermarks unrelated to the code itself, such as "generated by AI" or "Co-Authored-By: CODE
Slop Phrases3 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMxtuner/tools/tokenize_ftdp_datasets.py320 # 500 is a magic number, you can change it to any number you wantCOMMENT
LOW…/model/transformers_models/mixtral/modeling_mixtral.py794 # the current expert. We need to make sure to multiply the output hiddenCOMMENT
LOW…/model/transformers_models/mixtral/modeling_mixtral.py1437 loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same deviceCODE
Example Usage Blocks3 hits · 4 pts
SeverityFileLineSnippetContext
LOW.github/gh.sh7# Usage:COMMENT
LOWxtuner/v1/float8/triton_kernels/trans_quant_per_tile.py281 # Example usageCOMMENT
LOWxtuner/utils/rm_utils.py224 # Example usageCOMMENT
Overly Generic Function Names2 hits · 2 pts
SeverityFileLineSnippetContext
LOWautotest/cluster/clusterx.py89 def execute_task(self, task_config: Dict[str, Any]):CODE
LOWxtuner/dataset/moss_sft.py121 def process_data(self):CODE
Fake / Example Data2 hits · 2 pts
SeverityFileLineSnippetContext
LOWxtuner/v1/datasets/vlm_jsonl.py25 self.fake_data = {CODE
LOWxtuner/v1/datasets/vlm_jsonl.py48 data = self.tokenize_fn(self.fake_data)CODE