Repository Analysis

InternLM/xtuner

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

12.4 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of InternLM/xtuner, a Python project with 5,185 GitHub stars. SynthScan v2.0 examined 338,397 lines of code across 1588 source files, recording 3040 pattern matches distributed across 23 syntactic categories. The overall adjusted score of 12.4 places this repository in the Low 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).

12.4
Adjusted Score
12.4
Raw Score
100%
Time Factor
2026-08-28
Last Push
5.2K
Stars
Python
Language
338.4K
Lines of Code
1.6K
Files
3.0K
Pattern Hits
2026-08-29
Scan Date
0.11
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 2HIGH 174MEDIUM 202LOW 2662

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 3040 distinct pattern matches across 23 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 Identifiers1036 hits · 1050 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
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/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.py47def _tilelang_sparse_mla_available() -> bool:CODE
LOWtests/module/attention/test_dsa_mla.py61def _cudnn_dsa_sparse_mla_available() -> bool:CODE
LOWtests/module/attention/test_dsa_mla.py86def _tilelang_sparse_mla_inputs():CODE
LOWtests/module/attention/test_dsa_mla.py94def _cudnn_dsa_sparse_mla_inputs():CODE
LOWtests/module/attention/test_dsa_mla.py170 def test_packed_inputs_respect_causal_boundaries_and_backward(self):CODE
LOWtests/module/attention/test_dsa_mla.py195 def test_shared_layers_reuse_topk_without_cross_context_leak(self):CODE
LOWtests/module/attention/test_dsa_mla.py215 def test_reentrant_checkpoint_reuses_and_releases_topk(self):CODE
LOWtests/module/attention/test_dsa_mla.py243 def test_packed_attention_matches_full_sequence(self):CODE
LOWtests/module/attention/test_dsa_mla.py297 def test_tilelang_indexer_matches_torch(self):CODE
LOWtests/module/attention/test_dsa_mla.py338 def test_cudnn_local_query_global_kv_matches_full_sequence(self):CODE
LOWtests/module/attention/test_dsa_mla.py391 def test_tilelang_forward_backward_matches_torch(self):CODE
LOWtests/module/attention/test_dsa_mla.py422 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
LOWtests/module/dispatcher/test_torch_all2all.py22 def test_dispatch_and_combine(self, dtype, device):CODE
LOWtests/module/dispatcher/test_noep_expert_tp.py89 def test_sync_path_uses_real_tp_collectives(self) -> None:CODE
LOWtests/module/dispatcher/test_noep_expert_tp.py144 def test_async_path_exposes_events_at_stage_boundaries(self) -> None:CODE
LOWtests/module/dispatcher/test_noep_expert_tp.py246 def test_async_sync_path_matches_output_and_gradients(self) -> None:CODE
LOWtests/module/dispatcher/test_deepep_expert_tp.py42 def test_sync_virtual_expert_path_preserves_output_and_gradients(self) -> None:CODE
LOWtests/module/dispatcher/test_deepep_expert_tp.py131 def test_async_path_matches_sync_output_and_gradients(self) -> None:CODE
LOWtests/module/dispatcher/test_deepep_expert_tp.py208 def test_async_path_accepts_topk_weights_without_gradients(self) -> None:CODE
LOWtests/datasets/test_dataloader.py172def test_dataloader_resume_single_process(tmp_path, pack_level, num_workers, group_by_length, pack_workers):CODE
LOWtests/datasets/test_dataloader.py374def test_dataloader_resume_multi_process(tmp_path, pack_level, num_workers, group_by_length):CODE
LOWtests/datasets/test_pack_config_from_pack_infos.py47def test_pack_config_from_pack_infos_hundred_million_rows():CODE
LOWtests/datasets/test_pack_config_from_pack_infos.py110def test_pack_config_vectorized_matches_reference_small():CODE
976 more matches not shown…
Unused Imports883 hits · 820 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
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/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_checkpoint_wrapper_checker.py1CODE
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
LOWtests/model/test_qwen3_dense.py17CODE
823 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 · 528 pts
SeverityFileLineSnippetContext
MEDIUMtests/datasets/test_long_text_tokenize.py12# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_long_text_tokenize.py14# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_long_text_tokenize.py36# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_long_text_tokenize.py38# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_long_text_tokenize.py54# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_long_text_tokenize.py56# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_long_text_tokenize.py87# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_long_text_tokenize.py89# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_long_text_tokenize.py176# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_long_text_tokenize.py178# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_long_text_tokenize.py202# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/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
MEDIUMtests/datasets/test_preset_pack_dataset.py110# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_preset_pack_dataset.py112# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_preset_pack_dataset.py385# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_preset_pack_dataset.py387# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_preset_pack_dataset.py432# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_preset_pack_dataset.py434# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_preset_pack_dataset.py457# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_preset_pack_dataset.py459# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/datasets/test_preset_pack_dataset.py606# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/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
MEDIUMtests/optim/test_muon.py354 # ── Build two identical models ───────────────────────────────────────COMMENT
MEDIUMtests/optim/test_muon.py361 # ── Reference path ───────────────────────────────────────────────────COMMENT
MEDIUMtests/optim/test_muon.py367 # ── Production path ──────────────────────────────────────────────────COMMENT
MEDIUMtests/optim/test_muon.py32# ─── Test: Newton-Schulz functions ───────────────────────────────────────────COMMENT
MEDIUMtests/optim/test_muon.py91# ─── Model for end-to-end tests ──────────────────────────────────────────────COMMENT
MEDIUMtests/optim/test_muon.py179# ─── Reference optimizer ─────────────────────────────────────────────────────COMMENT
MEDIUMtests/optim/test_muon.py329# ─── Test: single-GPU correctness ───────────────────────────────────────────COMMENT
MEDIUMtests/optim/test_muon.py381 # ── Compare all parameters ───────────────────────────────────────────COMMENT
MEDIUMtests/optim/test_muon.py459# ─── Test: end-to-end FSDP ───────────────────────────────────────────────────COMMENT
MEDIUMtests/optim/test_muon.py487 # ── Build model on every rank, then broadcast rank-0 weights ─────────COMMENT
MEDIUMtests/optim/test_muon.py495 # ── Generate input data on rank 0 and scatter ────────────────────────COMMENT
MEDIUMtests/optim/test_muon.py506 # ── Reference: forward all samples, average loss ─────────────────────COMMENT
MEDIUMtests/optim/test_muon.py513 # ── Fully shard the test model (production path) ─────────────────────COMMENT
MEDIUMtests/optim/test_muon.py525 # ── Production Muon optimizer step ────────────────────────────────────COMMENT
MEDIUMtests/optim/test_muon.py532 # ── Compare all parameters ───────────────────────────────────────────COMMENT
MEDIUMtests/profiler/test_prober.py74# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/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…
Deep Nesting261 hits · 250 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
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.py258CODE
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.py251CODE
LOWtests/engine/test_glm52_moe_train_engine.py397CODE
LOWtests/engine/test_moe_train_engine_tpep.py387CODE
LOWtests/engine/test_moe_train_engine_tpep.py749CODE
LOWtests/rl/trace_utils.py154CODE
LOWtests/rl/test_replay_buffer.py666CODE
LOWtests/rl/test_qwen35_vl_moe_async_train_2step.py355CODE
LOWautotest/cluster/clusterx.py61CODE
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/check_metric.py55CODE
LOWautotest/utils/check_metric.py69CODE
LOWautotest/utils/check_metric.py102CODE
LOWautotest/utils/check_metric.py242CODE
LOWautotest/utils/check_metric.py343CODE
LOW.claude/skills/model_normalize/repack_hf.py57CODE
201 more matches not shown…
Excessive Try-Catch Wrapping210 hits · 217 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/engine/test_moe_train_engine_float8.py116 except Exception:CODE
LOWtests/engine/test_moe_train_engine_float8.py195 except Exception:CODE
LOWtests/engine/test_moe_train_engine_float8.py287 except Exception:CODE
LOWtests/engine/test_moe_train_engine_float8.py387 except Exception:CODE
LOWtests/engine/test_moe_train_engine_float8.py482 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_replay_buffer.py674 except Exception as exc:CODE
LOWtests/rl/test_rl_colocate_trainer.py379 except Exception as exc:CODE
LOWtests/rl/test_trace_store.py64 except Exception as exc:CODE
LOWautotest/cluster/clusterx.py99 except Exception as e:CODE
LOWautotest/cluster/clusterx.py134 except Exception as e:CODE
LOWautotest/cluster/clusterx.py159 except Exception:CODE
LOWautotest/cluster/clusterx.py167 except Exception as e:CODE
LOWautotest/cluster/clusterx.py181 except Exception as e:CODE
LOWautotest/cluster/clusterx.py189 except Exception as e:CODE
LOWautotest/cluster/clusterx.py210 except Exception as e:CODE
LOWautotest/cluster/clusterx.py222 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
LOW…ner/v1/datasets/mllm_tokenize_fn/intern_s1_vl_utils.py54 except Exception:CODE
LOW…r/v1/datasets/mllm_tokenize_fn/qwen3_vl_tokenize_fn.py510 except Exception as e:CODE
LOWxtuner/v1/_writer/jsonl_writer.py93 except Exception:CODE
LOWxtuner/v1/_writer/jsonl_writer.py128 except Exception:CODE
150 more matches not shown…
Cross-Language Confusion33 hits · 185 pts
SeverityFileLineSnippetContext
HIGHrecipe/trace/viewer/render.py227 if (left == null && right == null) return 0;CODE
HIGHrecipe/trace/viewer/render.py227 if (left == null && right == null) return 0;CODE
HIGHrecipe/trace/viewer/render.py228 if (left == null) return 1;CODE
HIGHrecipe/trace/viewer/render.py229 if (right == null) return -1;CODE
HIGHrecipe/trace/viewer/render.py236 return Array.from(new Set(values.filter((value) => value != null))).sort(compareValues);CODE
HIGHrecipe/trace/viewer/render.py240 if (payload.requested_train_step !== undefined && payload.requested_train_step !== null && payload.requested_trainCODE
HIGHrecipe/trace/viewer/render.py243 if (payload.selected_train_step !== undefined && payload.selected_train_step !== null) {CODE
HIGHrecipe/trace/viewer/render.py243 if (payload.selected_train_step !== undefined && payload.selected_train_step !== null) {CODE
HIGHrecipe/trace/viewer/render.py360 ["Samples", data.sample_count || 0],CODE
HIGHrecipe/trace/viewer/render.py361 ["Groups", data.group_count || 0],CODE
HIGHrecipe/trace/viewer/render.py362 ["Steps", data.step_count || 0],CODE
HIGHrecipe/trace/viewer/render.py424 if (node.elapsed_ms !== undefined && node.elapsed_ms !== null) return formatDurationMs(node.elapsed_ms);CODE
HIGHrecipe/trace/viewer/render.py424 if (node.elapsed_ms !== undefined && node.elapsed_ms !== null) return formatDurationMs(node.elapsed_ms);CODE
HIGHrecipe/trace/viewer/render.py425 if (node.duration_ms !== undefined && node.duration_ms !== null) return formatDurationMs(node.duration_ms);CODE
HIGHrecipe/trace/viewer/render.py425 if (node.duration_ms !== undefined && node.duration_ms !== null) return formatDurationMs(node.duration_ms);CODE
HIGHrecipe/trace/viewer/render.py430 const nodes = (sample.display_path && sample.display_path.length) ? sample.display_path : fallbackDisplayPath(samCODE
HIGHrecipe/trace/viewer/render.py465 if (data.service_name) sourceParts.push(`service ${data.service_name}`);CODE
HIGHrecipe/trace/viewer/render.py466 if (data.run_id) sourceParts.push(`run ${data.run_id}`);CODE
HIGHrecipe/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 Boilerplate118 hits · 119 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.py11logger = 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__.py27__all__ = [CODE
LOWxtuner/v1/module/attention/__init__.py9__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
LOWxtuner/v1/utils/process.py37def set_async_save_process_qos() -> None:CODE
LOWxtuner/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__ = ["checkpoint_wrapper", "pytree_reentrant_checkpoint", "module_dict_repr", "ModelForwardExtraLogInfo"]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/tilelang.py82def _setup_tilelang_sparse_mla_context(ctx, inputs, output) -> None:CODE
LOWxtuner/v1/ops/sparse_mla/__init__.py95__all__ = [CODE
LOWxtuner/v1/ops/sparse_mla/cudnn_dsa.py63def _setup_cudnn_dsa_sparse_mla_context(ctx, inputs, output) -> None:CODE
LOWxtuner/v1/ops/moe/cuda/triton_kernels/__init__.py30__all__ = ["k_grouped_gemm", "m_grouped_gemm"]CODE
LOWxtuner/v1/profiler/__init__.py23__all__ = [CODE
LOWxtuner/v1/engine/__init__.py6__all__ = [CODE
LOWxtuner/v1/rl/advantage/__init__.py16__all__ = [CODE
LOWxtuner/v1/rl/weight_update/transport.py1078 def _update_engines(self) -> None:CODE
LOWxtuner/v1/rl/weight_update/update_weighter.py79 def _set_transport(self) -> None:CODE
LOWxtuner/v1/rl/weight_update/__init__.py24__all__ = [CODE
58 more matches not shown…
AI Structural Patterns97 hits · 95 pts
SeverityFileLineSnippetContext
LOWtests/rl/test_replay_buffer.py43CODE
LOWtests/rl/test_prepare_train_data.py43CODE
LOWxtuner/v1/data_proto/sequence_context.py104CODE
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.py447CODE
LOWxtuner/v1/module/decoder_layer/moe_decoder_layer.py200CODE
LOWxtuner/v1/module/decoder_layer/moe_decoder_layer.py206CODE
LOWxtuner/v1/module/decoder_layer/dense_decoder_layer.py39CODE
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.py303CODE
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/train/trainer.py524CODE
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
LOWxtuner/v1/ops/flash_attn/gpu.py536CODE
37 more matches not shown…
Docstring Block Structure10 hits · 50 pts
SeverityFileLineSnippetContext
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
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.py468 # 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
MEDIUMxtuner/v1/rl/weight_update/transport.py643 # 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 Block40 hits · 40 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.yaml1581 timeout: 1080COMMENT
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/data_proto/sequence_context.py581 # Background:COMMENT
LOWxtuner/v1/loss/base_loss_ctx.py21# There are 3 steps to compute the calibrated loss:COMMENT
LOWxtuner/v1/config/fsdp.py21 mtp_checkpoint_use_reentrant: Annotated[COMMENT
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/attention/dsa_mla.py141 # q: [bsz, S, Ni, Di]; k: [bsz, S, Di]COMMENT
LOWxtuner/v1/module/decoder_layer/moe_decoder_layer.py421 post_dispatched = self.dispatcher.dispatch_postprocess(COMMENT
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/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/utils/checkpointing.py101) -> torch.Tensor | tuple[torch.Tensor, ...]:COMMENT
LOWxtuner/v1/model/moe/moe.py701 router_logits_list[micro_batch_idx][f"mtp_layer{mtp_idx}"] = mtp_router_resultsCOMMENT
LOWxtuner/v1/model/moe/moe.py1261 # 因而出现 original=COMPUTE、replay=REUSE,无法重建相同清单。COMMENT
LOWxtuner/v1/model/moe/moe.py1461 # For MoE models that can perform inference independently without FSDP,COMMENT
LOWxtuner/v1/train/trainer.py1961 )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
Modern AI Meta-Vocabulary13 hits · 33 pts
SeverityFileLineSnippetContext
MEDIUMtests/model/test_qwen3_5_dense.py274 # Whole-model bitwise parity that runs the real `compose.forward` / `Dense.forward` orchestrationCOMMENT
MEDIUMtests/model/test_qwen3_5_dense.py280 # layer present — it only needs the forward orchestration to run end-to-end. N=4 covers bothCOMMENT
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.py1101 # session_id is only set by agentic loops / XTUNER_DETERMINISTIC; plain RL falls backCOMMENT
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
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
MEDIUMxtuner/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
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.py444 # 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
Verbosity Indicators6 hits · 10 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
LOWxtuner/v1/rl/rollout_is.py207 # Step 1: Compute raw importance weights based on the specified levelCOMMENT
LOWxtuner/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 Overuse6 hits · 10 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
LOWxtuner/v1/rl/rollout_is.py207 # Step 1: Compute raw importance weights based on the specified levelCOMMENT
LOWxtuner/v1/rl/rollout_is.py274 # Step 2: Compute comprehensive metricsCOMMENT
LOWxtuner/v1/rl/rollout_is.py289 # Step 3: Apply outlier handling and rejection samplingCOMMENT
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.py61 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