Use PEFT or Full-parameter to CPT/SFT/DPO/GRPO 600+ LLMs (Qwen3.8, DeepSeek-V4, GLM-5.1, InternLM3, Llama4, ...) and 300+ MLLMs (Qwen3-VL, Qwen3-Omni, InternVL3.5, Ovis2.5, GLM5.3, Gemma4, Llava, Phi4, ...) (AAAI 2025).
This report summarizes scanner evidence for modelscope/ms-swift, a Python project with 15,808 GitHub stars. SynthScan examined 201,572 lines of code across 1446 source files, recording 3231 pattern matches distributed across 25 syntactic categories. The legacy adjusted pattern signal is 19.6 (Elevated pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 1809 finding(s).
Are imports declared and package/API names verified? 983 finding(s).
Are wrappers, guards, and repeated structures necessary? 1649 finding(s).
Which changes need focused human review? 3231 finding(s).
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.
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.
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.
The scanner identified 3231 distinct pattern matches across 25 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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_utils.py | 74 | def create_dummy_test_dataset(feat, label, num): | CODE |
| LOW⚡ | tests/run.py | 27 | def deduplicate_preserve_order(items): | CODE |
| LOW⚡ | tests/run.py | 31 | def get_available_npu_devices(visible_npus): | CODE |
| LOW | tests/run.py | 102 | def gather_test_suites_in_files(test_dir, case_file_list, list_tests): | CODE |
| LOW | tests/run.py | 157 | def async_run_command_with_popen(cmd, device_id): | CODE |
| LOW | tests/run.py | 347 | def run_non_parallelizable_test_suites(suites, result_dir): | CODE |
| LOW | tests/general/test_tool_schema_padding.py | 64 | def test_arrow_aligned_tools_are_restored(self): | CODE |
| LOW | tests/general/test_tool_schema_padding.py | 77 | def test_padding_is_removed_from_every_schema_position(self): | CODE |
| LOW | tests/general/test_tool_schema_padding.py | 162 | def test_semantic_nulls_and_literal_objects_are_preserved(self): | CODE |
| LOW | tests/general/test_tool_schema_padding.py | 189 | def test_dependencies_may_hold_property_names(self): | CODE |
| LOW | tests/general/test_tool_schema_padding.py | 202 | def test_non_dict_values_are_returned_as_is(self): | CODE |
| LOW | tests/general/test_tool_schema_padding.py | 265 | def test_loading_a_jsonl_keeps_every_tool_schema_intact(self): | CODE |
| LOW | tests/general/test_tool_schema_padding.py | 272 | def test_the_tools_column_is_stored_as_json(self): | CODE |
| LOW | tests/general/test_tool_schema_padding.py | 284 | def test_concatenating_datasets_keeps_both_tool_schemas(self): | CODE |
| LOW⚡ | tests/general/test_tool_schema_padding.py | 295 | def test_batched_cast_does_not_drop_tool_fields(self): | CODE |
| LOW⚡ | tests/general/test_tool_schema_padding.py | 305 | def test_a_json_string_column_is_parsed(self): | CODE |
| LOW⚡ | tests/general/test_tool_schema_padding.py | 312 | def test_a_single_tool_dict_becomes_a_list(self): | CODE |
| LOW⚡ | tests/general/test_tool_schema_padding.py | 319 | def test_non_dict_tools_are_left_untouched(self): | CODE |
| LOW⚡ | tests/general/test_tool_schema_padding.py | 327 | def test_a_bare_string_becomes_a_single_element_list(self): | CODE |
| LOW⚡ | tests/general/test_tool_schema_padding.py | 334 | def test_a_json_scalar_is_not_split_into_characters(self): | CODE |
| LOW | tests/general/test_tool_schema_padding.py | 345 | def test_every_tool_column_is_normalized(self): | CODE |
| LOW | tests/general/test_tool_schema_padding.py | 353 | def test_rows_without_tools_are_untouched(self): | CODE |
| LOW | tests/general/test_dataset_source.py | 11 | def test_dataset_syntax_parses_explicit_hub_prefixes(self): | CODE |
| LOW | tests/general/test_dataset_source.py | 15 | def test_explicit_ms_source_overrides_global_hf_default(self): | CODE |
| LOW | tests/general/test_dataset_list.py | 11 | def test_builtin_named_dataset(self): | CODE |
| LOW | tests/general/test_dataset_list.py | 16 | def test_named_and_unnamed_datasets_use_selected_hub(self): | CODE |
| LOW | tests/general/test_model.py | 83 | def test_seq_cls_architectures_rewrite(self): | CODE |
| LOW | tests/general/test_model.py | 106 | def test_seq_cls_architectures_unknown_suffix(self): | CODE |
| LOW | tests/general/test_model.py | 116 | def test_seq_cls_architectures_saved_config(self): | CODE |
| LOW | tests/general/test_model.py | 155 | def test_seq_cls_architectures_saved_config_deepcopy(self): | CODE |
| LOW | tests/general/test_model.py | 181 | def test_seq_cls_architectures_saved_config_pickle(self): | CODE |
| LOW | tests/general/test_model.py | 196 | def test_seq_cls_architectures_non_main_then_main(self): | CODE |
| LOW | tests/general/test_model.py | 211 | def test_seq_cls_architectures_pickle_fresh_process(self): | CODE |
| LOW | tests/general/test_model.py | 246 | def test_seq_cls_architectures_save_failure_cleanup(self): | STRING |
| LOW | tests/general/test_model.py | 262 | def test_seq_cls_architectures_failure_before_config_save(self): | STRING |
| LOW | tests/general/test_model.py | 281 | def test_seq_cls_architectures_existing_save_wrapper(self): | STRING |
| LOW | tests/general/test_model.py | 298 | def test_seq_cls_architectures_none_keeps_class_name(self): | STRING |
| LOW | tests/general/test_model.py | 318 | def test_seq_cls_architectures_post_patch_assignment_kept(self): | STRING |
| LOW | tests/general/test_model.py | 333 | def test_seq_cls_architectures_unpatched_instance_unaffected(self): | STRING |
| LOW⚡ | tests/general/test_protocol_tool_choice.py | 30 | def test_selected_tool_keeps_only_that_tool(self): | CODE |
| LOW⚡ | tests/general/test_protocol_tool_choice.py | 34 | def test_unknown_tool_raises_value_error(self): | CODE |
| LOW⚡ | tests/general/test_protocol_tool_choice.py | 38 | def test_string_tool_choice_keeps_every_tool(self): | CODE |
| LOW | tests/general/test_qwen3_coder_agent_template.py | 41 | def test_encode_tool_call_content(self): | CODE |
| LOW | tests/general/test_qwen3_coder_agent_template.py | 101 | def test_plain_assistant_content_is_preserved(self): | CODE |
| LOW | tests/general/test_qwen3_coder_agent_template.py | 139 | def test_non_assistant_prefix_is_unchanged(self): | CODE |
| LOW | tests/general/test_qwen3_5_fp32_weights.py | 219 | def test_serializes_overlapping_policy_contexts(self): | CODE |
| LOW | tests/general/test_multimodal_optimizer.py | 30 | def test_full_and_peft_parameter_coverage(self): | CODE |
| LOW | tests/general/test_lisa_callback.py | 54 | def test_lisa_can_be_created_before_trainer_initialization(self): | CODE |
| LOW | tests/general/test_lisa_callback.py | 67 | def test_lisa_does_not_freeze_layers_before_optimizer_creation(self): | CODE |
| LOW | tests/general/test_lisa_callback.py | 73 | def test_newly_activated_lisa_layers_receive_optimizer_updates(self): | CODE |
| LOW | tests/general/test_lisa_callback.py | 108 | def test_lisa_rejects_adapter_training(self): | CODE |
| LOW | tests/general/test_moss_vl.py | 48 | def test_template_state_and_unsupported_modes(self): | CODE |
| LOW | tests/general/test_moss_vl.py | 64 | def test_video_pixel_limits_are_routed_to_video_processor(self): | CODE |
| LOW | tests/general/test_moss_vl.py | 104 | def test_video_environment_limits_are_supported(self): | CODE |
| LOW | tests/general/test_moss_vl.py | 137 | def test_truncation_preserves_media_contract(self): | CODE |
| LOW | tests/general/test_moss_vl.py | 163 | def test_cross_attention_masks_are_padded(self): | CODE |
| LOW | tests/general/test_moss_vl.py | 195 | def test_inference_cross_attention_masks_are_left_padded(self): | CODE |
| LOW | tests/general/test_moss_vl.py | 228 | def test_media_metadata_is_collated(self): | CODE |
| LOW | tests/general/test_moss_vl.py | 253 | def test_mixed_media_and_text_only_batch_contract(self): | CODE |
| LOW | tests/general/test_moss_vl.py | 299 | def test_non_module_aligner_parameter_is_not_scanned_for_lora(self): | CODE |
| 1111 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | setup.py | 7 | CODE | |
| LOW | tests/run.py | 37 | CODE | |
| LOW | tests/llm/test_template.py | 52 | CODE | |
| LOW | tests/deploy/test_rollout_auth_comprehensive.py | 11 | CODE | |
| LOW | tests/deploy/test_rollout_auth_comprehensive.py | 12 | CODE | |
| LOW | tests/models/test_mllm.py | 8 | CODE | |
| LOW | tests/models/test_mllm.py | 8 | CODE | |
| LOW | tests/rollout/test_server_exact_token_io.py | 215 | CODE | |
| LOW | …sts/sequence_parallel/test_zigzag_ring_attn_npu_e2e.py | 10 | CODE | |
| LOW | …sts/sequence_parallel/test_zigzag_ring_attn_npu_e2e.py | 73 | CODE | |
| LOW | …ts/sequence_parallel/test_zigzag_ring_attn_cuda_e2e.py | 73 | CODE | |
| LOW | tests/sequence_parallel/test_zigzag_ring_attn_npu.py | 12 | CODE | |
| LOW | tests/train/test_resume_from_checkpoint.py | 29 | CODE | |
| LOW | tests/train/test_resume_from_checkpoint.py | 29 | CODE | |
| LOW | tests/train/test_freeze.py | 18 | CODE | |
| LOW | tests/train/test_freeze.py | 18 | CODE | |
| LOW | tests/train/test_freeze.py | 36 | CODE | |
| LOW | tests/train/test_freeze.py | 36 | CODE | |
| LOW | tests/train/test_freeze.py | 54 | CODE | |
| LOW | tests/train/test_freeze.py | 54 | CODE | |
| LOW | tests/train/test_freeze.py | 72 | CODE | |
| LOW | tests/train/test_freeze.py | 72 | CODE | |
| LOW | tests/test_align/test_padding_side.py | 51 | CODE | |
| LOW | tests/megatron/test_megatron_args.py | 23 | CODE | |
| LOW | tests/megatron/test_megatron_args.py | 23 | CODE | |
| LOW | swift/__init__.py | 13 | CODE | |
| LOW | swift/__init__.py | 18 | CODE | |
| LOW | swift/__init__.py | 18 | CODE | |
| LOW | swift/__init__.py | 19 | CODE | |
| LOW | swift/__init__.py | 19 | CODE | |
| LOW | swift/__init__.py | 19 | CODE | |
| LOW | swift/__init__.py | 19 | CODE | |
| LOW | swift/__init__.py | 19 | CODE | |
| LOW | swift/__init__.py | 19 | CODE | |
| LOW | swift/__init__.py | 19 | CODE | |
| LOW | swift/__init__.py | 19 | CODE | |
| LOW | swift/__init__.py | 19 | CODE | |
| LOW | swift/__init__.py | 19 | CODE | |
| LOW | swift/__init__.py | 19 | CODE | |
| LOW | swift/__init__.py | 22 | CODE | |
| LOW | swift/__init__.py | 22 | CODE | |
| LOW | swift/__init__.py | 23 | CODE | |
| LOW | swift/__init__.py | 23 | CODE | |
| LOW | swift/__init__.py | 24 | CODE | |
| LOW | swift/__init__.py | 24 | CODE | |
| LOW | swift/__init__.py | 24 | CODE | |
| LOW | swift/__init__.py | 24 | CODE | |
| LOW | swift/__init__.py | 24 | CODE | |
| LOW | swift/__init__.py | 24 | CODE | |
| LOW | swift/__init__.py | 24 | CODE | |
| LOW | swift/__init__.py | 24 | CODE | |
| LOW | swift/__init__.py | 24 | CODE | |
| LOW | swift/__init__.py | 24 | CODE | |
| LOW | swift/__init__.py | 26 | CODE | |
| LOW | swift/__init__.py | 26 | CODE | |
| LOW | swift/__init__.py | 27 | CODE | |
| LOW | swift/__init__.py | 27 | CODE | |
| LOW | swift/__init__.py | 27 | CODE | |
| LOW | swift/__init__.py | 27 | CODE | |
| LOW | swift/__init__.py | 27 | CODE | |
| 915 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | setup.py | 24 | CODE | |
| LOW | setup.py | 44 | CODE | |
| LOW | setup.py | 78 | CODE | |
| LOW | setup.py | 96 | CODE | |
| LOW | tests/test_utils.py | 124 | CODE | |
| LOW | tests/run.py | 58 | CODE | |
| LOW | tests/run.py | 102 | CODE | |
| LOW | tests/run.py | 217 | CODE | |
| LOW | tests/run.py | 236 | CODE | |
| LOW | tests/run.py | 375 | CODE | |
| LOW | tests/run.py | 489 | CODE | |
| LOW | tests/general/test_model.py | 116 | CODE | |
| LOW | tests/general/test_model.py | 262 | CODE | |
| LOW | tests/general/test_qwen3_coder_agent_template.py | 41 | CODE | |
| LOW | tests/general/test_qwen3_5_fp32_weights.py | 24 | CODE | |
| LOW | tests/general/test_qwen3_5_fp32_weights.py | 219 | CODE | |
| LOW | tests/general/test_qwen3_5_fp32_weights.py | 291 | CODE | |
| LOW | tests/general/test_multimodal_optimizer.py | 30 | CODE | |
| LOW | tests/general/test_glm4_5_agent_template.py | 119 | CODE | |
| LOW | tests/general/test_glm4_5_agent_template.py | 135 | CODE | |
| LOW | tests/general/test_frozen_vision.py | 63 | CODE | |
| LOW | tests/general/test_arch.py | 1 | CODE | |
| LOW | tests/general/test_cls_generation_preprocessor.py | 10 | CODE | |
| LOW | tests/general/test_activation_offload_views.py | 39 | CODE | |
| LOW | tests/general/test_rejected_response.py | 124 | CODE | |
| LOW | tests/general/test_rejected_response.py | 181 | CODE | |
| LOW | tests/general/test_dataset_routing_tag.py | 80 | CODE | |
| LOW | tests/utils/test_multiturn_length_rewards.py | 32 | CODE | |
| LOW | tests/utils/test_tool_response_name.py | 41 | CODE | |
| LOW | tests/utils/test_gemma4_tool_responses.py | 21 | CODE | |
| LOW | tests/utils/test_gemma4_tool_responses.py | 44 | CODE | |
| LOW | tests/utils/test_reranker_metrics.py | 21 | CODE | |
| LOW | tests/utils/test_dpo_precompute.py | 32 | CODE | |
| LOW | tests/utils/test_embedding_metrics_dp.py | 28 | CODE | |
| LOW | tests/utils/test_reranker_loss.py | 17 | CODE | |
| LOW | tests/sequence_parallel/test_output_unpadding.py | 15 | CODE | |
| LOW | tests/sequence_parallel/test_seq_accuracy.py | 21 | CODE | |
| LOW | tests/sequence_parallel/test_custom_cross_entropy.py | 28 | CODE | |
| LOW | tests/train/test_vllm_importance_sampling_basic.py | 49 | CODE | |
| LOW | tests/train/test_cross_entropy_loss.py | 12 | CODE | |
| LOW | tests/train/test_gkd_loss.py | 11 | CODE | |
| LOW | tests/train/test_gkd_loss.py | 54 | CODE | |
| LOW | tests/train/test_gkd_loss.py | 86 | CODE | |
| LOW | tests/infer/test_transformers_worker.py | 62 | CODE | |
| LOW | tests/infer/test_transformers_worker.py | 83 | CODE | |
| LOW | tests/infer/test_transformers_worker.py | 158 | CODE | |
| LOW | tests/test_align/test_rlhf_loss.py | 280 | CODE | |
| LOW | tests/test_align/test_rlhf_loss.py | 330 | CODE | |
| LOW | tests/test_align/test_rlhf_loss.py | 357 | CODE | |
| LOW | tests/megatron/test_muon_lr.py | 365 | CODE | |
| LOW | swift/metrics/acc.py | 10 | CODE | |
| LOW | swift/ui/base.py | 268 | CODE | |
| LOW | swift/ui/base.py | 314 | CODE | |
| LOW | swift/ui/llm_export/llm_export.py | 101 | CODE | |
| LOW | swift/ui/llm_grpo/llm_grpo.py | 216 | CODE | |
| LOW | swift/ui/llm_grpo/external_rollout.py | 145 | CODE | |
| LOW | swift/ui/llm_grpo/tuner.py | 18 | CODE | |
| LOW | swift/ui/llm_rlhf/llm_rlhf.py | 232 | CODE | |
| LOW | swift/ui/llm_rlhf/tuner.py | 18 | CODE | |
| LOW | swift/ui/llm_sample/llm_sample.py | 166 | CODE | |
| 355 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tests/general/test_arch.py | 18 | except Exception: | CODE |
| HIGH | tests/infer/test_transformers_worker.py | 30 | except SystemExit: | CODE |
| HIGH | tests/test_align/test_template/test_agent.py | 852 | except ValueError: | CODE |
| HIGH | swift/ui/llm_infer/runtime.py | 146 | except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess): | CODE |
| HIGH | swift/ui/llm_infer/runtime.py | 214 | except IOError: | CODE |
| HIGH | swift/ui/llm_infer/runtime.py | 231 | except IndexError: | CODE |
| HIGH | swift/ui/llm_train/runtime.py | 453 | except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess): | CODE |
| HIGH | swift/ui/llm_train/runtime.py | 541 | except IOError: | CODE |
| HIGH | swift/dataset/preprocessor/core.py | 136 | except json.JSONDecodeError: | CODE |
| HIGH | swift/rlhf_trainers/utils.py | 126 | except ValueError: | CODE |
| HIGH | swift/rlhf_trainers/utils.py | 135 | except socket.gaierror: | CODE |
| HIGH | swift/rlhf_trainers/utils.py | 316 | except ImportError: | CODE |
| HIGH | swift/rlhf_trainers/utils.py | 1009 | except (ImportError, AttributeError, RuntimeError): | CODE |
| HIGH | swift/rlhf_trainers/utils.py | 1199 | except Exception: | CODE |
| HIGH | swift/rlhf_trainers/vllm_client.py | 119 | except Exception: | CODE |
| HIGH | swift/rlhf_trainers/grpo_trainer.py | 15 | except ImportError: | CODE |
| HIGH | swift/template/template_inputs.py | 49 | except json.JSONDecodeError: | CODE |
| HIGH | swift/template/utils.py | 95 | except ValueError: | CODE |
| HIGH | swift/template/vision_utils.py | 124 | except Exception: | CODE |
| HIGH | swift/template/vision_utils.py | 454 | except OSError: | CODE |
| HIGH | swift/template/vision_utils.py | 438 | except OSError: | CODE |
| HIGH | swift/pipelines/infer/rollout.py | 15 | except ImportError: | CODE |
| HIGH | swift/pipelines/infer/rollout.py | 70 | except ImportError: | CODE |
| HIGH | swift/pipelines/infer/rollout.py | 413 | except Exception: # noqa: BLE001 | CODE |
| HIGH | swift/pipelines/infer/rollout.py | 560 | except BufferError: | CODE |
| HIGH | swift/pipelines/export/merge_lora.py | 23 | except Exception: | CODE |
| HIGH | swift/utils/hub_utils.py | 213 | except ImportError: | CODE |
| HIGH | swift/utils/utils.py | 308 | except OSError: | CODE |
| HIGH | swift/utils/hf_config.py | 177 | except AttributeError: | CODE |
| HIGH | swift/utils/url_utils.py | 148 | except ValueError: | CODE |
| HIGH | swift/utils/torch_utils.py | 242 | except Exception: | CODE |
| HIGH | swift/utils/torch_utils.py | 255 | except Exception: | CODE |
| HIGH | swift/optimizers/muonclip.py | 360 | except ValueError: | CODE |
| HIGH | swift/trainers/mixin.py | 967 | except (ImportError, AttributeError): | CODE |
| HIGH | swift/rollout/multi_turn.py | 259 | except AttributeError: | CODE |
| HIGH | swift/rollout/multi_turn.py | 861 | except Exception: | CODE |
| HIGH | swift/rollout/multi_turn.py | 974 | except Exception: | CODE |
| HIGH | swift/rollout/openenv_wrapper.py | 61 | except Exception: | CODE |
| HIGH | swift/sequence_parallel/sequence_parallel.py | 150 | except ImportError: | CODE |
| HIGH | swift/rl_core/data.py | 291 | except json.JSONDecodeError: | CODE |
| HIGH | swift/model/register.py | 116 | except Exception: | CODE |
| HIGH | swift/model/register.py | 297 | except ValueError: | CODE |
| HIGH | swift/model/patcher.py | 472 | except (AttributeError, TypeError): | CODE |
| HIGH | swift/model/models/moonshot.py | 20 | except AttributeError: | CODE |
| HIGH | swift/model/models/llama.py | 333 | except AttributeError: | CODE |
| HIGH | swift/model/models/qwen.py | 68 | except Exception: | CODE |
| HIGH | swift/model/models/qwen.py | 53 | except Exception: | CODE |
| HIGH | swift/model/models/qwen.py | 59 | except Exception: | CODE |
| HIGH | swift/model/models/qwen.py | 89 | except AttributeError: | CODE |
| HIGH | swift/model/models/qwen.py | 1572 | except Exception: | CODE |
| HIGH | swift/model/models/qwen.py | 2423 | except ImportError: | CODE |
| HIGH | swift/model/npu_patch/model.py | 282 | except Exception: | CODE |
| HIGH | swift/model/npu_patch/mindspeed.py | 298 | except Exception: | CODE |
| HIGH | swift/infer_engine/vllm_engine.py | 965 | except asyncio.exceptions.CancelledError: | CODE |
| HIGH | swift/infer_engine/infer_engine.py | 209 | except (TypeError, ValueError): | CODE |
| HIGH | swift/hub/hub.py | 223 | except HTTPError: | CODE |
| HIGH | swift/ray/megatron/resource_pool.py | 142 | except Exception: # noqa: BLE001 | CODE |
| HIGH | swift/ray/megatron/rollout/replica.py | 282 | except Exception: # noqa: BLE001 | CODE |
| HIGH | swift/ray/megatron/rollout/ray_vllm_engine.py | 225 | except Exception: | CODE |
| HIGH | swift/ray/megatron/rollout/weight_transfer.py | 171 | except OSError: | CODE |
| 14 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/utils/test_assemble_teacher_topk_logprobs.py | 10 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/utils/test_assemble_teacher_topk_logprobs.py | 12 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/utils/test_assemble_teacher_topk_logprobs.py | 30 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/utils/test_assemble_teacher_topk_logprobs.py | 32 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/utils/test_assemble_teacher_topk_logprobs.py | 76 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/utils/test_assemble_teacher_topk_logprobs.py | 78 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_align/test_mm_processor_align.py | 41 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_align/test_mm_processor_align.py | 43 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_align/test_mm_processor_align.py | 196 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_align/test_mm_processor_align.py | 198 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_align/test_mm_processor_align.py | 229 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_align/test_mm_processor_align.py | 231 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_align/test_mm_processor_align.py | 262 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_align/test_mm_processor_align.py | 264 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_align/test_mm_processor_align.py | 295 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_align/test_mm_processor_align.py | 297 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_align/test_mm_processor_align.py | 361 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_align/test_mm_processor_align.py | 363 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_align/test_mm_processor_align.py | 457 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_align/test_mm_processor_align.py | 459 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | swift/rlhf_trainers/gkd_loss.py | 9 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | swift/rlhf_trainers/gkd_loss.py | 11 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | swift/rlhf_trainers/gkd_loss.py | 71 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | swift/rlhf_trainers/gkd_loss.py | 73 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | swift/rlhf_trainers/gkd_loss.py | 89 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | swift/rlhf_trainers/gkd_loss.py | 91 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | swift/rlhf_trainers/gkd_loss.py | 151 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | swift/rlhf_trainers/gkd_loss.py | 153 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | swift/rlhf_trainers/gkd_loss.py | 170 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | swift/rlhf_trainers/gkd_loss.py | 172 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | swift/rlhf_trainers/gkd_loss.py | 219 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | swift/rlhf_trainers/gkd_loss.py | 221 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | swift/rlhf_trainers/utils.py | 1886 | # ============================================================================ | COMMENT |
| MEDIUM⚡ | swift/rlhf_trainers/utils.py | 1888 | # ============================================================================ | COMMENT |
| MEDIUM | swift/rlhf_trainers/grpo_trainer.py | 454 | # -------------------------------------------------- | COMMENT |
| MEDIUM | swift/rlhf_trainers/grpo_trainer.py | 456 | # -------------------------------------------------- | COMMENT |
| MEDIUM | swift/rlhf_trainers/grpo_trainer.py | 489 | # -------------------------------------------------- | COMMENT |
| MEDIUM | swift/rlhf_trainers/grpo_trainer.py | 491 | # -------------------------------------------------- | COMMENT |
| MEDIUM | swift/pipelines/infer/rollout.py | 319 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM | swift/pipelines/infer/rollout.py | 321 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM | swift/pipelines/infer/rollout.py | 441 | # ── Step 1: receive + rebuild IPC handle (with reuse) ──────── | COMMENT |
| MEDIUM | swift/pipelines/infer/rollout.py | 479 | # ── Step 2: stream buckets and load_weights per bucket ────── | COMMENT |
| MEDIUM⚡ | swift/rollout/multi_turn.py | 867 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM⚡ | swift/rollout/multi_turn.py | 869 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM⚡ | swift/rollout/multi_turn.py | 919 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM⚡ | swift/rollout/multi_turn.py | 921 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM⚡ | swift/rollout/multi_turn.py | 931 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM⚡ | swift/rollout/multi_turn.py | 933 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM | swift/rollout/multi_turn.py | 138 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM | swift/rollout/multi_turn.py | 147 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM | swift/rollout/openenv_wrapper.py | 38 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM | swift/rollout/openenv_wrapper.py | 40 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM⚡ | swift/rollout/openenv_wrapper.py | 80 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM⚡ | swift/rollout/openenv_wrapper.py | 83 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM⚡ | swift/model/npu_patch/model.py | 210 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | swift/model/npu_patch/model.py | 212 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | swift/model/npu_patch/model.py | 220 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | swift/model/npu_patch/model.py | 222 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | swift/model/npu_patch/model.py | 19 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | swift/model/npu_patch/model.py | 21 | # --------------------------------------------------------------------------- | COMMENT |
| 25 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | tests/run.py | 39 | except Exception as e: | CODE |
| LOW | tests/run.py | 383 | except Exception: | CODE |
| LOW | tests/model_tag.py | 66 | except Exception as e: | CODE |
| LOW | tests/model_tag.py | 94 | except Exception as e: | CODE |
| LOW | tests/model_tag.py | 115 | except Exception as e: | CODE |
| LOW | tests/model_tag.py | 131 | except Exception as e: | CODE |
| MEDIUM | tests/model_tag.py | 53 | def _post_request(self, url, param): | CODE |
| MEDIUM | tests/model_tag.py | 72 | def batch_commit_result(self): | CODE |
| MEDIUM | tests/model_tag.py | 100 | def batch_refresh_stage(self): | CODE |
| MEDIUM | tests/model_tag.py | 121 | def query_model_stage(self): | CODE |
| LOW | tests/general/test_arch.py | 18 | except Exception: | CODE |
| LOW | tests/general/test_packing_multiprocessing_context.py | 93 | except Exception as exc: | CODE |
| LOW | tests/deploy/test_dataset.py | 12 | except Exception: | CODE |
| LOW | …sts/sequence_parallel/test_zigzag_ring_attn_npu_e2e.py | 74 | except Exception: | CODE |
| LOW | …ts/sequence_parallel/test_zigzag_ring_attn_cuda_e2e.py | 74 | except Exception: | CODE |
| LOW | tests/sequence_parallel/test_zigzag_ring_attn_npu.py | 14 | except Exception: | CODE |
| MEDIUM | tests/sequence_parallel/test_zigzag_ring_attn_npu.py | 10 | def _npu_available(): | CODE |
| LOW | tests/train/test_vllm_importance_sampling_basic.py | 477 | except Exception as e: | CODE |
| LOW | tests/test_align/test_mm_processor_align.py | 560 | except Exception: | CODE |
| LOW | tests/megatron/test_ray_gkd.py | 195 | except Exception as e: # noqa: megatron-core not installed in this env | CODE |
| LOW | tests/megatron/test_ray_gkd.py | 387 | except Exception: | CODE |
| LOW | tests/megatron/test_ray_gkd.py | 400 | except Exception as e: # noqa | CODE |
| LOW | tests/megatron/test_muon_lr.py | 16 | except Exception as e: | CODE |
| LOW | tests/megatron/test_checkpoint_symlink.py | 14 | except Exception as e: | CODE |
| LOW | docs/source/BestPractices/GRPO.md | 78 | except Exception as e: | STRING |
| LOW | docs/source/BestPractices/GRPO-Multi-Modal-Training.md | 79 | except Exception: | CODE |
| LOW | docs/source/BestPractices/GRPO-Multi-Modal-Training.md | 96 | except Exception: | CODE |
| LOW | …source/Instruction/GRPO/DeveloperGuide/reward_model.md | 118 | except Exception as e: | STRING |
| LOW | docs/source_en/BestPractices/GRPO.md | 82 | except Exception as e: | STRING |
| LOW | …s/source_en/BestPractices/GRPO-Multi-Modal-Training.md | 85 | except Exception: | CODE |
| LOW | …s/source_en/BestPractices/GRPO-Multi-Modal-Training.md | 102 | except Exception: | CODE |
| LOW | …rce_en/Instruction/GRPO/DeveloperGuide/reward_model.md | 117 | except Exception as e: | CODE |
| LOW | swift/ui/base.py | 347 | except Exception as e: | CODE |
| LOW | swift/ui/base.py | 368 | except Exception: | CODE |
| LOW | swift/ui/llm_grpo/external_runtime.py | 138 | except Exception as e: | CODE |
| LOW | swift/ui/llm_eval/eval.py | 103 | except Exception as e: | CODE |
| LOW | swift/ui/llm_infer/runtime.py | 135 | except Exception: | CODE |
| LOW | swift/ui/llm_infer/runtime.py | 305 | except Exception as e: | CODE |
| LOW | swift/ui/llm_infer/runtime.py | 315 | except Exception: | CODE |
| LOW | swift/ui/llm_train/runtime.py | 383 | except Exception: | CODE |
| LOW | swift/ui/llm_train/runtime.py | 428 | except Exception: | CODE |
| LOW | swift/ui/llm_train/runtime.py | 688 | except Exception as e: | CODE |
| LOW | swift/ui/llm_train/runtime.py | 702 | except Exception: | CODE |
| LOW | swift/ui/llm_train/runtime.py | 726 | except Exception: | CODE |
| LOW | swift/ui/llm_train/llm_train.py | 406 | except Exception as e: | CODE |
| LOW | swift/ui/llm_train/llm_train.py | 530 | except Exception as err: | CODE |
| LOW | swift/dataset/utils.py | 100 | except Exception as e: | CODE |
| LOW | swift/dataset/packing.py | 30 | except Exception: | CODE |
| LOW | swift/dataset/packing.py | 238 | except Exception as e: | CODE |
| LOW | swift/dataset/loader.py | 117 | except Exception as e: | CODE |
| LOW | swift/dataset/dataset/mllm.py | 797 | except Exception: | CODE |
| LOW | swift/dataset/preprocessor/core.py | 233 | except Exception as e: | CODE |
| LOW | swift/rewards/prm.py | 90 | except Exception: | STRING |
| LOW | swift/rewards/prm.py | 148 | except Exception: | STRING |
| LOW | swift/rewards/orm.py | 114 | except Exception: | CODE |
| LOW | swift/rewards/orm.py | 251 | except Exception: | CODE |
| LOW | swift/rewards/orm.py | 258 | except Exception: | CODE |
| LOW | swift/rewards/orm.py | 300 | except Exception: | CODE |
| LOW | swift/rewards/orm.py | 374 | except Exception: | CODE |
| LOW | swift/rewards/orm.py | 422 | except Exception: | CODE |
| 173 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tests/llm/test_custom.py | 0 | task: based on the given two sentences, provide a similarity score between 0.0 and 1.0. sentence 1: {text1} sentence 2: | STRING |
| HIGH | examples/custom/dataset.py | 0 | task: based on the given two sentences, provide a similarity score between 0.0 and 1.0. sentence 1: {text1} sentence 2: | STRING |
| HIGH | swift/dataset/dataset/llm.py | 0 | task: based on the given two sentences, provide a similarity score between 0.0 and 1.0. sentence 1: {text1} sentence 2: | STRING |
| HIGH | docs/source/BestPractices/GRPO.md | 0 | evaluates completions based on mathematical correctness of the answer args: completions (list[str]): generated outputs t | STRING |
| HIGH | docs/source_en/BestPractices/GRPO.md | 0 | evaluates completions based on mathematical correctness of the answer args: completions (list[str]): generated outputs t | STRING |
| HIGH | examples/train/grpo/plugin/plugin.py | 0 | evaluates completions based on mathematical correctness of the answer args: completions (list[str]): generated outputs t | STRING |
| HIGH | docs/source/BestPractices/GRPO-Multi-Modal-Training.md | 0 | reward function that checks if the completion is correct. args: completions (list[str]): generated outputs solution (lis | STRING |
| HIGH | …s/source_en/BestPractices/GRPO-Multi-Modal-Training.md | 0 | reward function that checks if the completion is correct. args: completions (list[str]): generated outputs solution (lis | STRING |
| HIGH | examples/train/grpo/plugin/plugin.py | 0 | reward function that checks if the completion is correct. args: completions (list[str]): generated outputs solution (lis | STRING |
| HIGH | docs/source/BestPractices/AMD-support.md | 0 | you are a helpful math assistant. solve the problem step by step and put your final answer within \\boxed{}. | STRING |
| HIGH | docs/source/BestPractices/Qwen3_8-Best-Practice.md | 0 | you are a helpful math assistant. solve the problem step by step and put your final answer within \\boxed{}. | STRING |
| HIGH | docs/source_en/BestPractices/AMD-support.md | 0 | you are a helpful math assistant. solve the problem step by step and put your final answer within \\boxed{}. | STRING |
| HIGH | docs/source_en/BestPractices/Qwen3_8-Best-Practice.md | 0 | you are a helpful math assistant. solve the problem step by step and put your final answer within \\boxed{}. | STRING |
| HIGH | examples/models/qwen3_5/mcore_grpo_moe.sh | 0 | you are a helpful math assistant. solve the problem step by step and put your final answer within \\boxed{}. | STRING |
| HIGH | examples/train/grpo/opd_rl.sh | 0 | you are a helpful math assistant. solve the problem step by step and put your final answer within \\boxed{}. | STRING |
| HIGH | examples/train/grpo/plugin/gsm8k/gsm8k.sh | 0 | you are a helpful math assistant. solve the problem step by step and put your final answer within \\boxed{}. | STRING |
| HIGH | examples/train/grpo/internal/fipo.sh | 0 | you are a helpful math assistant. solve the problem step by step and put your final answer within \\boxed{}. | STRING |
| HIGH | examples/train/grpo/internal/real.sh | 0 | you are a helpful math assistant. solve the problem step by step and put your final answer within \\boxed{}. | STRING |
| HIGH | examples/megatron/grpo/opd_rl.sh | 0 | you are a helpful math assistant. solve the problem step by step and put your final answer within \\boxed{}. | STRING |
| HIGH | examples/megatron/grpo/real.sh | 0 | you are a helpful math assistant. solve the problem step by step and put your final answer within \\boxed{}. | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | docs/README.md | 18 | Load data from json/yaml/pickle files. This method provides a unified api for loading data from serialized file | STRING |
| HIGH | swift/dataset/loader.py | 249 | Load and preprocess datasets. This function provides a unified interface to load datasets from various sources (Hug | STRING |
| HIGH | swift/rlhf_trainers/rollout_mixin.py | 536 | Split model parameters into batches for synchronized weight transfer. This method divides model parameters into | STRING |
| HIGH | swift/rlhf_trainers/rollout_mixin.py | 1821 | Attempt to encode each input using the template. If encoding fails, resample from a backup iterator unt | STRING |
| HIGH | swift/template/register.py | 81 | Get or create a template instance for model input/output formatting. This function retrieves the appropriate templa | STRING |
| HIGH | swift/loss_scale/mapping.py | 21 | Factory function to create a loss scale object from a string specification. The loss_scale string supports the foll | STRING |
| HIGH | swift/utils/hub_utils.py | 30 | Download model snapshot safely with DDP context protection. This function attempts to download a model from Hugging | STRING |
| HIGH | swift/utils/torch_utils.py | 288 | Get the last valid (non-padding) token position indices for each sample. This function correctly handles seque | STRING |
| HIGH | swift/rollout/multi_turn.py | 177 | Perform asynchronous batched inference for multiple rollout requests. This method serves as the main e | STRING |
| HIGH | swift/rollout/multi_turn.py | 330 | Execute multi-turn conversation rollout with built-in turn management logic. This implements the default multi- | STRING |
| HIGH | swift/rl_core/resample.py | 27 | Replace samples whose encode fails with fresh ones from ``data_iterator``. Caps the TOTAL encode attempts (fail-fas | STRING |
| HIGH | swift/model/register.py | 569 | Load a pretrained model and its processor from a model hub or local path. Args: model_id_or_path: The model | STRING |
| HIGH | swift/megatron/trainers/grpo_trainer.py | 1291 | Attempt to encode each input using the template. If encoding fails, resample from a backup iterator unt | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/megatron/test_ray_gkd.py | 262 | # Create a minimal mock trainer instance (bypass __init__) | COMMENT |
| MEDIUM | tests/megatron/test_ray_gkd.py | 327 | # Create a minimal mock trainer | COMMENT |
| MEDIUM | swift/callbacks/perf_log.py | 128 | # This function is never used. | COMMENT |
| MEDIUM | swift/rewards/rm_plugin.py | 3 | # This module provides plugins for integrating external reward models, | COMMENT |
| MEDIUM | swift/rewards/rm_plugin.py | 170 | # Define a mapping for role capitalization if needed | STRING |
| MEDIUM | swift/rlhf_trainers/utils.py | 330 | # Create a DeepSpeedPlugin with the processed config | COMMENT |
| MEDIUM | swift/rlhf_trainers/grpo_trainer.py | 1919 | # Create a copy to avoid modifying the original table used by other loggers. | COMMENT |
| MEDIUM | swift/template/base.py | 537 | # This function is only used to handle scenarios where the model needs | COMMENT |
| MEDIUM⚡ | swift/template/base.py | 1719 | """This function is important for multi-modal training, as it registers the post_encode method | STRING |
| MEDIUM | swift/pipelines/train/tuner.py | 155 | """This function is only useful on the vera tuner""" | STRING |
| MEDIUM | swift/pipelines/infer/rollout.py | 151 | # Create a stateless process group to manage communication between training processes and vLLM workers. | COMMENT |
| MEDIUM | swift/pipelines/eval/utils.py | 140 | # Create a future to receive the result asynchronously | COMMENT |
| MEDIUM | swift/utils/hf_config.py | 13 | """This class is used to read config from config.json(maybe params.json also)""" | STRING |
| MEDIUM | swift/tuners/peft.py | 110 | # Create a 1-element tensor then expand with stride-0: no real memory alloc | COMMENT |
| MEDIUM | swift/rollout/multi_turn.py | 638 | # Create a RolloutOutput for the current round | COMMENT |
| MEDIUM | swift/rollout/multi_turn.py | 703 | # Create a mock inputs object to use the template's _swift_prepare_inputs method | COMMENT |
| MEDIUM | examples/models/qwen3_tts/prepare_data.py | 1 | # This file is used to generate `audio_codes` in the dataset. | COMMENT |
| MEDIUM⚡ | examples/train/grpo/plugin/plugin.py | 72 | # Define a regex pattern that only allows numbers, operators, parentheses, and whitespace | COMMENT |
| MEDIUM⚡ | examples/train/grpo/plugin/plugin.py | 219 | # Create the sandbox by hand, currently there's no context manager for this version | COMMENT |
| MEDIUM⚡ | examples/train/grpo/plugin/plugin.py | 225 | # Create a list of tasks for running scripts concurrently | COMMENT |
| MEDIUM | examples/train/grpo/plugin/plugin.py | 204 | # Create a new event loop and set it | COMMENT |
| MEDIUM | examples/train/think_model/qwen3_demo1.sh | 3 | # This method is also applicable to the Deepseek-R1 series of models. | COMMENT |
| MEDIUM | examples/custom/my_qwen2_5_omni/my_register.py | 306 | """This function is typically used to solve the zero2/zero3 hanging issue in mixed model training, | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/general/test_dataset.py | 21 | 'AI-ModelScope/LongAlpaca-12k#1000' | COMMENT |
| LOW | tests/general/test_dataset.py | 81 | COMMENT | |
| LOW | tests/train/test_sft.py | 481 | # test_mllm_streaming_mp_ddp() | COMMENT |
| LOW | tests/test_align/test_vllm_vlm.py | 201 | # test_qwen2_5_omni() | COMMENT |
| LOW | tests/test_align/test_template/test_agent.py | 901 | return text.replace('\n', '') | COMMENT |
| LOW | tests/test_align/test_template/test_agent.py | 921 | # test_llama4() | COMMENT |
| LOW | tests/test_align/test_template/test_llm.py | 801 | assert ('Reasoning effort is set to' in text) is (reasoning_effort != 'medium'), reasoning_effort | COMMENT |
| LOW | tests/test_align/test_template/test_llm.py | 821 | # test_llama() | COMMENT |
| LOW | tests/test_align/test_template/test_llm.py | 841 | # test_qwen3() | COMMENT |
| LOW | tests/test_align/test_template/test_llm.py | 861 | # test_minicpm5() | COMMENT |
| LOW | tests/test_align/test_template/test_video.py | 401 | logger = get_logger() | COMMENT |
| LOW | …sts/test_align/test_template/test_deepseek_v4_flash.py | 1 | import os | COMMENT |
| LOW | tests/test_align/test_template/test_vision.py | 1321 | COMMENT | |
| LOW | tests/test_align/test_template/test_vision.py | 1341 | # test_deepseek_janus() | COMMENT |
| LOW | tests/test_align/test_template/test_vision.py | 1361 | # test_mplug_owl3() | COMMENT |
| LOW | tests/test_align/test_template/test_vision.py | 1381 | # test_gemma3n() | COMMENT |
| LOW | tests/test_align/test_template/test_vision.py | 1401 | # test_sensenova_si() | COMMENT |
| LOW | tests/test_align/test_template/test_template.py | 161 | COMMENT | |
| LOW | tests/eval/test_eval.py | 61 | test_eval_llm() | COMMENT |
| LOW | tests/export/test_quant.py | 101 | # test_bert() | COMMENT |
| LOW | docs/source/conf.py | 1 | # Configuration file for the Sphinx documentation builder. | COMMENT |
| LOW | docs/source/conf.py | 81 | COMMENT | |
| LOW | docs/source_en/conf.py | 1 | # Configuration file for the Sphinx documentation builder. | COMMENT |
| LOW | docs/source_en/conf.py | 81 | COMMENT | |
| LOW | docs/source_en/Megatron-SWIFT/LoRA-Training.md | 141 | # swift export | COMMENT |
| LOW | swift/rlhf_trainers/grpo_trainer.py | 181 | COMMENT | |
| LOW | swift/pipelines/infer/rollout.py | 321 | # ------------------------------------------------------------------ | COMMENT |
| LOW | swift/model/models/xing4_0.py | 101 | f'{previous_options}, but this load requests {patch_options}. ' | COMMENT |
| LOW | swift/model/models/deepseek.py | 281 | # vocabulary, but this composite subclasses PreTrainedConfig directly and | COMMENT |
| LOW | examples/ascend/activation_cpu_offload/train.sh | 41 | # {'train_runtime': 79.7064, 'train_samples_per_second': 6.311, 'train_steps_per_second': 0.201, 'train_loss': 1.9164841 | COMMENT |
| LOW | examples/deploy/vllm_dp.sh | 1 | CUDA_VISIBLE_DEVICES=0,1 swift deploy \ | COMMENT |
| LOW | examples/deploy/vllm_dp.sh | 21 | # "temperature": 0 | COMMENT |
| LOW | examples/deploy/vllm.sh | 1 | CUDA_VISIBLE_DEVICES=0 swift deploy \ | COMMENT |
| LOW | examples/models/gpt_oss/internvl3_5_gpt.sh | 41 | --padding_free false \ | COMMENT |
| LOW | examples/models/qwen3_next/mtp.sh | 41 | --sequence_parallel true \ | COMMENT |
| LOW | examples/models/gemma4/gemma4_unified.sh | 41 | --group_by_length true \ | COMMENT |
| LOW | examples/models/xing4_0/lora_sft_hf.sh | 1 | # Xing4.0-29B-A4B: trust_remote_code MoE (64 routed experts, top-4) + MLA + mHC. | COMMENT |
| LOW | examples/models/deepseek_v41/megatron_sft.sh | 1 | #!/bin/bash | COMMENT |
| LOW | examples/models/deepseek_v41/megatron_grpo.sh | 1 | #!/bin/bash | COMMENT |
| LOW | examples/models/qwen3_5/mcore.sh | 61 | # CUDA_VISIBLE_DEVICES=0,1,2,3 \ | COMMENT |
| LOW | examples/models/qwen3_5/transformers.sh | 41 | # IMAGE_MAX_TOKEN_NUM=1024 \ | COMMENT |
| LOW | examples/models/qwen3_5/fp8.sh | 61 | # swift infer \ | COMMENT |
| LOW | examples/train/on_policy_distillation.sh | 1 | # On-Policy Distillation https://thinkingmachines.ai/blog/on-policy-distillation/ | COMMENT |
| LOW | …mples/train/multimodal/lora_llm_full_vit/merge_lora.sh | 1 | CUDA_VISIBLE_DEVICES=0 \ | COMMENT |
| LOW | …s/train/sequence_parallel/sequence_parallel_qwen3_5.sh | 21 | --logging_steps 1 \ | COMMENT |
| LOW | examples/train/rlhf/opsd/opsd.sh | 1 | # OPSD Training Script | COMMENT |
| LOW | examples/train/grpo/plugin/run_external_scheduler.sh | 1 | # This script require main branch ms-swift | COMMENT |
| LOW | …es/train/grpo/plugin/openenv/run_grpo_sudoku_server.sh | 1 | # ============================================================ | COMMENT |
| LOW | …es/train/grpo/plugin/openenv/run_grpo_sudoku_server.sh | 21 | # | COMMENT |
| LOW | examples/train/grpo/plugin/openenv/run_grpo_sudoku.sh | 1 | # ============================================================ | COMMENT |
| LOW | examples/train/grpo/plugin/deepeyes/deepeyes.sh | 1 | # 8 * 80G | COMMENT |
| LOW | examples/train/grpo/internal/full_lmdeploy.sh | 1 | # The LMDeploy backend in GRPO has been deprecated in Swift 3.5. | COMMENT |
| LOW | examples/train/grpo/external/vllm_multi_turn.sh | 1 | # Exp: https://github.com/modelscope/ms-swift/pull/5307#issuecomment-3219803922 | COMMENT |
| LOW | examples/megatron/mcore_bridge/full/dense.sh | 41 | # VIDEO_MAX_TOKEN_NUM=128 \ | COMMENT |
| LOW | examples/megatron/mcore_bridge/lora/seq_cls.sh | 41 | --no_save_rng true \ | COMMENT |
| LOW | examples/megatron/multimodal/lora_llm_vit_full/sft.sh | 61 | # IMAGE_MAX_TOKEN_NUM=1024 \ | COMMENT |
| LOW | examples/megatron/grpo/dense_server.sh | 1 | # MAX_PIXELS=602112 \ | COMMENT |
| LOW | examples/megatron/grpo/deepseek_v41_colocate_lora.sh | 1 | # DeepSeek-V4.1-Flash LoRA GRPO (Megatron + vLLM colocate). | COMMENT |
| LOW | examples/megatron/grpo/deepseek_v41_colocate_full.sh | 1 | # DeepSeek-V4.1-Flash full-parameter GRPO (Megatron + vLLM colocate). | COMMENT |
| LOW | examples/megatron/lora/mtp.sh | 41 | --dataloader_num_workers 8 \ | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | tests/utils/test_rewards.py | 194 | '### Step 1: Recall the formula\n\n' | CODE |
| LOW⚡ | tests/utils/test_rewards.py | 196 | '### Step 2: Use the given terms\n\n' | CODE |
| LOW⚡ | tests/utils/test_rewards.py | 201 | '### Step 3: Find $a_9$\n\n' | CODE |
| LOW | …s/source/Instruction/GRPO/DeveloperGuide/multi_turn.md | 118 | 'solution': "To solve the problem, we need to evaluate the expression \\(\\sqrt{36 \\times \\sqrt{16}}\\).\n\nWe | STRING |
| LOW | docs/source_en/Instruction/Distillation.md | 253 | # Step 1: Deploy teacher model (max_logprobs must be >= gkd_logits_topk) | COMMENT |
| LOW | docs/source_en/Instruction/Distillation.md | 260 | # Step 2: Start GKD training | COMMENT |
| LOW | …ource_en/Instruction/GRPO/DeveloperGuide/multi_turn.md | 121 | 'solution': "To solve the problem, we need to evaluate the expression \\(\\sqrt{36 \\times \\sqrt{16}}\\).\n\nWe | STRING |
| LOW⚡ | swift/metrics/reranker.py | 74 | # Step 1: Find all positive sample indices (query boundaries) | COMMENT |
| LOW⚡ | swift/metrics/reranker.py | 80 | # Step 2: Split into groups (queries) | COMMENT |
| LOW | swift/metrics/reranker.py | 98 | # Step 3: Calculate metrics for each query independently | COMMENT |
| LOW | swift/metrics/reranker.py | 148 | # Step 4: Return scores for averaging locally or across data-parallel ranks. | COMMENT |
| LOW | swift/template/templates/minicpm.py | 473 | # Step 1: Base encode — produces input_ids with -100 for images | COMMENT |
| LOW | swift/template/templates/minicpm.py | 487 | # Step 2: Process images — replace -100 tokens with image placeholders | COMMENT |
| LOW | swift/template/templates/minicpm.py | 501 | # Step 3: Process audios — expand audio_start/audio_end pairs with <unk> tokens | COMMENT |
| LOW⚡ | swift/template/templates/minicpm.py | 539 | # Step 4: Compute image_bound using start/end token boundaries | COMMENT |
| LOW | swift/template/templates/minicpm.py | 564 | # Step 5: Compute audio_bounds | COMMENT |
| LOW⚡ | swift/sequence_parallel/sequence_parallel.py | 440 | # Step 1: Gather from all sequence parallel ranks | COMMENT |
| LOW⚡ | swift/sequence_parallel/sequence_parallel.py | 448 | # Step 2: Gather all rp chunks | COMMENT |
| LOW⚡ | swift/megatron/trainers/vocab_parallel_utils.py | 77 | # Step 1: Find global max for numerical stability. This is a constant shift and is | COMMENT |
| LOW⚡ | swift/megatron/trainers/vocab_parallel_utils.py | 84 | # Step 2: Compute exp(logits - max) and sum across all TP ranks. Every rank's | COMMENT |
| LOW⚡ | swift/megatron/trainers/vocab_parallel_utils.py | 89 | # Step 3: Compute log_softmax | COMMENT |
| LOW⚡ | swift/megatron/trainers/grpo_trainer.py | 308 | # Step 2: Compute KL from logps if kl_in_reward is enabled | COMMENT |
| LOW⚡ | swift/megatron/trainers/grpo_trainer.py | 313 | # Step 3: Compute the per-sequence base advantage (with ref-KL penalty if kl_in_reward). | COMMENT |
| LOW⚡ | swift/megatron/trainers/grpo_trainer.py | 317 | # Step 4: Write the advantage onto each batch, expanding the per-sequence base advantage to | COMMENT |
| LOW | swift/megatron/trainers/grpo_trainer.py | 279 | # Step 1: Encode batches and compute logps first (unified flow like GRPOTrainer) | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | tests/utils/test_rewards.py | 194 | '### Step 1: Recall the formula\n\n' | CODE |
| LOW⚡ | tests/utils/test_rewards.py | 196 | '### Step 2: Use the given terms\n\n' | CODE |
| LOW⚡ | tests/utils/test_rewards.py | 201 | '### Step 3: Find $a_9$\n\n' | CODE |
| LOW⚡ | swift/metrics/reranker.py | 74 | # Step 1: Find all positive sample indices (query boundaries) | COMMENT |
| LOW⚡ | swift/metrics/reranker.py | 80 | # Step 2: Split into groups (queries) | COMMENT |
| LOW | swift/metrics/reranker.py | 98 | # Step 3: Calculate metrics for each query independently | COMMENT |
| LOW | swift/metrics/reranker.py | 148 | # Step 4: Return scores for averaging locally or across data-parallel ranks. | COMMENT |
| LOW | swift/template/templates/minicpm.py | 473 | # Step 1: Base encode — produces input_ids with -100 for images | COMMENT |
| LOW | swift/template/templates/minicpm.py | 487 | # Step 2: Process images — replace -100 tokens with image placeholders | COMMENT |
| LOW | swift/template/templates/minicpm.py | 501 | # Step 3: Process audios — expand audio_start/audio_end pairs with <unk> tokens | COMMENT |
| LOW⚡ | swift/template/templates/minicpm.py | 539 | # Step 4: Compute image_bound using start/end token boundaries | COMMENT |
| LOW | swift/template/templates/minicpm.py | 564 | # Step 5: Compute audio_bounds | COMMENT |
| LOW⚡ | swift/sequence_parallel/sequence_parallel.py | 440 | # Step 1: Gather from all sequence parallel ranks | COMMENT |
| LOW⚡ | swift/sequence_parallel/sequence_parallel.py | 448 | # Step 2: Gather all rp chunks | COMMENT |
| LOW⚡ | swift/megatron/trainers/vocab_parallel_utils.py | 77 | # Step 1: Find global max for numerical stability. This is a constant shift and is | COMMENT |
| LOW⚡ | swift/megatron/trainers/vocab_parallel_utils.py | 84 | # Step 2: Compute exp(logits - max) and sum across all TP ranks. Every rank's | COMMENT |
| LOW⚡ | swift/megatron/trainers/vocab_parallel_utils.py | 89 | # Step 3: Compute log_softmax | COMMENT |
| LOW⚡ | swift/megatron/trainers/grpo_trainer.py | 308 | # Step 2: Compute KL from logps if kl_in_reward is enabled | COMMENT |
| LOW⚡ | swift/megatron/trainers/grpo_trainer.py | 313 | # Step 3: Compute the per-sequence base advantage (with ref-KL penalty if kl_in_reward). | COMMENT |
| LOW⚡ | swift/megatron/trainers/grpo_trainer.py | 317 | # Step 4: Write the advantage onto each batch, expanding the per-sequence base advantage to | COMMENT |
| LOW | swift/megatron/trainers/grpo_trainer.py | 279 | # Step 1: Encode batches and compute logps first (unified flow like GRPOTrainer) | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/run.py | 486 | CODE | |
| LOW | tests/utils/test_async_rewards.py | 77 | CODE | |
| LOW | tests/train/test_opsd.py | 44 | CODE | |
| LOW | swift/dataset/loader.py | 226 | CODE | |
| LOW | swift/dataset/loader.py | 24 | CODE | |
| LOW | swift/dataset/preprocessor/core.py | 468 | CODE | |
| LOW | swift/template/register.py | 55 | CODE | |
| LOW | swift/template/base.py | 82 | CODE | |
| LOW | swift/template/base.py | 2102 | CODE | |
| LOW | swift/template/templates/llava.py | 132 | CODE | |
| LOW | swift/utils/torch_utils.py | 331 | CODE | |
| LOW | swift/tuners/lora_layers.py | 542 | CODE | |
| LOW | swift/optimizers/muonclip.py | 193 | CODE | |
| LOW | swift/optimizers/galore/adamw8bit.py | 11 | CODE | |
| LOW | swift/optimizers/galore/adafactor.py | 96 | CODE | |
| LOW | swift/sequence_parallel/ulysses.py | 71 | CODE | |
| LOW | swift/sequence_parallel/ulysses.py | 41 | CODE | |
| LOW | swift/sequence_parallel/ulysses.py | 88 | CODE | |
| LOW | swift/sequence_parallel/zigzag_ring_attn.py | 699 | CODE | |
| LOW | swift/model/register.py | 541 | CODE | |
| LOW | swift/model/register.py | 658 | CODE | |
| LOW | swift/model/register.py | 163 | CODE | |
| LOW | swift/model/model_meta.py | 251 | CODE | |
| LOW | swift/model/model_meta.py | 254 | CODE | |
| LOW | swift/model/models/mllm.py | 235 | CODE | |
| LOW | swift/model/models/qwen.py | 1034 | CODE | |
| LOW | swift/model/models/qwen.py | 1998 | CODE | |
| LOW | swift/model/models/qwen.py | 2234 | CODE | |
| LOW | swift/model/models/baichuan.py | 56 | CODE | |
| LOW | swift/model/models/gemma.py | 235 | CODE | |
| LOW | swift/infer_engine/vllm_engine.py | 123 | CODE | |
| LOW | swift/infer_engine/sglang_engine.py | 29 | CODE | |
| LOW | swift/infer_engine/lmdeploy_engine.py | 41 | CODE | |
| LOW | swift/infer_engine/lmdeploy_engine.py | 190 | CODE | |
| LOW | swift/infer_engine/transformers_engine.py | 53 | CODE | |
| LOW | swift/ray/megatron/rollout/ray_vllm_engine.py | 27 | CODE | |
| LOW | swift/ray/megatron/rollout/vllm_server.py | 82 | CODE | |
| LOW | swift/megatron/utils/convert_utils.py | 189 | CODE | |
| LOW | swift/megatron/model/utils.py | 109 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | swift/ui/llm_infer/runtime.py | 137 | # Check if the process is still alive | COMMENT |
| LOW | swift/ui/llm_train/runtime.py | 430 | # Check if the process is still alive | COMMENT |
| LOW | swift/callbacks/activation_cpu_offload.py | 601 | # Check if model is wrapped with FSDP | COMMENT |
| LOW | swift/callbacks/activation_cpu_offload.py | 605 | # Check if fsdp_config is a dictionary and has activation_cpu_offload enabled | COMMENT |
| LOW | swift/callbacks/lisa.py | 56 | # Check if it's time to switch active layers, including at step 0 | COMMENT |
| LOW | swift/rlhf_trainers/utils.py | 1029 | # Check if already patched (idempotent). On NPU/vLLM-Ascend, sleep/wake | COMMENT |
| LOW | swift/rlhf_trainers/utils.py | 1063 | # Check if inner_model has layers attribute | COMMENT |
| LOW | swift/rlhf_trainers/grpo_trainer.py | 2251 | # Set max_length to None to disable truncation, as the input length has already been truncated earlier. | COMMENT |
| LOW | swift/pipelines/eval/utils.py | 168 | # Check if we've reached the desired batch size | COMMENT |
| LOW | swift/trainers/mixin.py | 463 | # Check if we should delete older checkpoint(s) | COMMENT |
| LOW | swift/trainers/reranker_trainer.py | 18 | # Check if we have a custom loss function | COMMENT |
| LOW | swift/rollout/multi_turn.py | 442 | # Check if the number of logprobs matches the number of loss_mask=1 tokens | COMMENT |
| LOW | swift/infer_engine/utils.py | 533 | # Check if we have a cached last_output from the previous iteration. | COMMENT |
| LOW | swift/infer_engine/utils.py | 600 | # Check if need to run the usual non-async path | COMMENT |
| LOW⚡ | swift/hub/hub.py | 351 | # Write the file if it has changed | COMMENT |
| LOW | swift/arguments/rlhf_args.py | 739 | # Check if teacher_deepspeed is a predefined name | COMMENT |
| LOW | swift/megatron/utils/megatron_lm_utils.py | 684 | # Set bucket_size to infinity if overlap_grad_reduce is False. | COMMENT |
| LOW | swift/agent_template/minimax_m2.py | 72 | # Check if using react format | COMMENT |
| LOW⚡ | examples/train/grpo/plugin/plugin.py | 68 | # Check if all numbers are used exactly once | COMMENT |
| LOW⚡ | examples/train/grpo/plugin/plugin.py | 80 | # Check if the equation is correct and matches the ground truth | COMMENT |
| LOW | examples/train/grpo/plugin/plugin.py | 56 | # Check if the format is correct | COMMENT |
| LOW | examples/train/grpo/plugin/openenv/sudoku_scheduler.py | 303 | # Check if env says invalid | COMMENT |
| LOW | examples/train/grpo/plugin/openenv/sudoku_scheduler.py | 308 | # Check if move targets an empty cell | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | swift/rlhf_trainers/rollout_mixin.py | 199 | def _setup_teacher(self) -> None: | CODE |
| LOW | swift/rlhf_trainers/rollout_mixin.py | 1596 | def set_default_max_tokens(_self, request_config: RequestConfig, inputs: Dict[str, Any]) -> None: | CODE |
| LOW | swift/rlhf_trainers/utils.py | 1681 | def set_expandable_segments(enable: bool) -> None: | CODE |
| LOW | swift/rlhf_trainers/vllm_client.py | 41 | logger = logging.getLogger(__name__) | CODE |
| LOW⚡ | swift/template/base.py | 1712 | def set_mode(self, mode: Literal['transformers', 'vllm', 'lmdeploy', 'sglang', 'train', 'rlhf', 'kto']) -> None: | CODE |
| LOW | swift/pipelines/infer/deploy.py | 263 | def _set_request_config(self, request_config) -> None: | CODE |
| LOW | swift/pipelines/infer/rollout.py | 172 | def update_named_param(self, name: str, dtype: str, shape: Sequence[int]) -> None: | CODE |
| LOW | swift/pipelines/infer/rollout.py | 204 | def update_adapter_flattened_param(self, peft_config: Dict, metadatas: list[Dict]) -> None: | CODE |
| LOW | swift/pipelines/infer/rollout.py | 233 | def update_adapter_param(self, peft_config: Dict, lora_tensors_metadata: list[Dict]) -> None: | CODE |
| LOW | swift/pipelines/infer/rollout.py | 272 | def update_flattened_params(self, metadatas: list[Dict]) -> None: | CODE |
| LOW⚡ | swift/rollout/multi_turn.py | 89 | def set_assistant_message_token_ids(self, infer_request: 'RolloutInferRequest', token_ids: List[int]) -> None: | CODE |
| LOW | swift/sequence_parallel/utils.py | 149 | def set_epoch(self, epoch: int) -> None: | CODE |
| LOW | swift/model/npu_patcher.py | 8 | __all__ = ['NPUCastError', 'apply_all_patches', 'apply_mindspeed_patches', 'patch_mindspeed_fla_gdn_implementation'] | CODE |
| LOW | swift/model/npu_patch/vllm_ascend_memory.py | 88 | __all__ = [ | CODE |
| LOW | swift/model/npu_patch/vllm_ascend.py | 93 | __all__ = [ | CODE |
| LOW | swift/model/npu_patch/__init__.py | 49 | __all__ = ['NPUCastError', 'apply_all_patches', 'apply_mindspeed_patches', 'patch_mindspeed_fla_gdn_implementation'] | CODE |
| LOW | swift/model/npu_patch/megatron_checkpoint.py | 226 | __all__ = ['load_optimizer_state_dict', 'optimizer_sharded_state_dict'] | CODE |
| LOW | swift/model/npu_patch/vllm_ascend_moe.py | 455 | __all__ = [ | CODE |
| LOW | swift/model/npu_patch/vllm_ascend_lora.py | 226 | __all__ = [ | CODE |
| LOW | swift/infer_engine/infer_engine.py | 235 | def set_default_max_tokens(self, request_config: RequestConfig, inputs: Dict[str, Any]) -> None: | CODE |
| LOW | swift/ray/megatron/base_trainer.py | 42 | def set_data_info(self, data_info: Dict[str, Any]) -> None: | CODE |
| LOW | swift/ray/megatron/rollout/adapter.py | 11 | logger = logging.getLogger(__name__) | CODE |
| LOW | swift/ray/megatron/checkpoint_engine/__init__.py | 8 | __all__ = [ | CODE |
| LOW | swift/megatron/utils/megatron_fsdp_checkpoint.py | 15 | __all__ = [ | CODE |
| LOW⚡ | swift/megatron/utils/megatron_lm_utils.py | 611 | def _set_fsdp_tensor_parallel_attributes(param, partition_dim: int) -> None: | CODE |
| LOW | swift/megatron/trainers/rollout_mixin.py | 181 | def _setup_teacher(self) -> None: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tests/general/test_tool_schema_padding.py | 28 | # missing fields of each tool with null, which used to reach the prompt as foreign | COMMENT |
| HIGH⚡ | swift/rlhf_trainers/gkd_loss.py | 81 | """KL(target || input), returns per-position scalar [N].""" | STRING |
| HIGH | swift/rlhf_trainers/grpo_trainer.py | 2451 | - kl: Direct KL divergence estimator KL(π_rollout || π_training) | STRING |
| HIGH⚡ | swift/hub/hub.py | 357 | repo.push(commit_message) | CODE |
| HIGH | swift/megatron/trainers/vocab_parallel_utils.py | 151 | KL(target || input) = sum(target_prob * (target_log_prob - input_log_prob)) | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | docs/source/Instruction/GRPO/DeveloperGuide/gym_env.md | 358 | - https://github.com/alibaba/ROLL/tree/main/roll/pipeline/agentic/env/frozen_lake | CODE |
| MEDIUM | docs/source_en/Instruction/Evaluation.md | 165 | ├── example_dev.csv # (Optional) The filename should follow the format `{subset_name}_dev.csv` for few-shot evaluation | CODE |
| MEDIUM | …cs/source_en/Instruction/GRPO/AdvancedResearch/FIPO.md | 5 | [FIPO](https://arxiv.org/abs/2603.19835) is a value-free RL method for eliciting longer and deeper reasoning. It keeps t | CODE |
| MEDIUM | …s/source_en/Instruction/GRPO/DeveloperGuide/gym_env.md | 205 | - https://github.com/alibaba/ROLL/tree/main/roll/pipeline/agentic/env/frozen_lake | CODE |
| MEDIUM | swift/template/templates/llm.py | 375 | # reasoning_effort: "no_think", "low", "high" (deep chain-of-thought) | COMMENT |
| MEDIUM | swift/sequence_parallel/zigzag_ring_attn.py | 708 | window_size=(-1, -1), # -1 means infinite context window | CODE |
| MEDIUM | examples/megatron/grpo/multi_turn/frozen_lake_plugin.py | 12 | # code borrowed from ROLL/roll/pipeline/agentic/env/frozen_lake | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | examples/megatron/fp8/vlm.sh | 2 | # In this example, FP8 training does not provide any speedup. | COMMENT |
| HIGH | examples/megatron/fp8/llm.sh | 3 | # In this example, FP8 training does not provide any speedup. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | swift/model/models/qwen.py | 2128 | loss.device) # make sure to reside in the same device | CODE |
| MEDIUM | examples/train/multi-gpu/fsdp2_lora/train.sh | 2 | # NOTE: for swift>=3.12, you can use --fsdp fsdp2 instead of accelerate launch | COMMENT |
| MEDIUM | examples/train/multi-gpu/fsdp_qlora/train.sh | 2 | # NOTE: for swift>=3.12, you can use --fsdp fsdp2 instead of accelerate launch | COMMENT |
| MEDIUM | examples/megatron/fp8/lora.sh | 3 | # However, you can use BF16 weights to perform Merge-LoRA. | COMMENT |
| MEDIUM | examples/megatron/fp8/lora.sh | 64 | # Alternatively, you can use BF16 base model + BF16 LoRA for inference | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | docs/source/Instruction/Sample.md | 80 | OPENAI_API_KEY="your_api_key" \ | CODE |
| HIGH | docs/source_en/Instruction/Sample.md | 84 | OPENAI_API_KEY="your_api_key" \ | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/train/test_vllm_importance_sampling_basic.py | 20 | # In testing, just return the tensor as-is | COMMENT |
| MEDIUM⚡ | swift/template/templates/minicpm.py | 540 | # This is more robust than finding consecutive <unk> tokens, especially | COMMENT |
| LOW | examples/megatron/export/lora.sh | 3 | # simply set `--merge_lora true` | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | …s/source_en/BestPractices/GRPO-Multi-Modal-Training.md | 278 | This task is based on the experiments in [open-r1-multimodal](https://github.com/EvolvingLMMs-Lab/open-r1-multimodal.git | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/infer/test_infer_engine.py | 24 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | tests/utils/test_local_rank.py | 54 | self.assert_levels('placeholder', 20) | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | swift/callbacks/activation_cpu_offload.py | 485 | def my_function(*inputs): | CODE |