Readme update - #10195
Open
indigoRM wants to merge 34 commits into
Open
Readme update#10195indigoRM wants to merge 34 commits into
indigoRM wants to merge 34 commits into
Conversation
change lint chekc to ruff
…delscope#10061) * feat(dev): wire Ulysses sequence parallelism into the HF SFT path TemplateConfig.sequence_parallel_size had no consumer on the HF transformers path: setting it >1 silently trained with SP=1. Feed twinkle's built-in Ulysses SP the one thing it needs -- a DeviceMesh with ulysses_size > 1: - builders/model.py: build_hf_device_mesh() (None for sp<=1 or non-local mode, preserving the deliberate no-mesh local path); build_model/_build_transformers_model gain a device_mesh pass-through - builders/dataset.py: build_dataset(device_mesh=...) -> _twinkle_loader_layout uses per_device * mesh.data_world_size and hands the mesh to the twinkle loader so its DeviceMeshSampler slices by data_rank (SP peers receive identical samples) - recipe/assembly.py: plan_sp_mesh() stage in TrainAssembly.fit, shared by all seven recipes; the mesh flows to build_dataset and build_model - config/validate.py: _check_hf_sequence_parallel, six fail-fast gates (megatron backend, any rlhf_type, padding_free/packing without flash attention, padding_side != right, FSDP, world<2 or world%sp!=0) * test(dev): cover HF Ulysses SP wiring (gates, mesh math, NPU e2e) - component/config/test_hf_sp_config.py: gate matrix for _check_hf_sequence_parallel (every rejection fires with the right message; legal combos pass) + build_hf_device_mesh math over a real 2-proc gloo group (_runners/hf_sp_mesh.py) - feature/sft/test_e2e.py::test_run_sft_hf_sp_matches_single (slow, 2 accel): torchrun x2 sp=2 vs single-process sp=1 on identical samples; asserts plumbing (ulysses_size==2, data_world_size==1, _enable_sp, strategy constructed), cross-rank loss identity, and value parity vs the single-process run (bf16 band) - feature/sft/test_e2e.py::test_run_sft_hf_sp_hybrid_dp (slow, >=4 accel): torchrun x4 sp=2 vs torchrun x2 sp=1 pure-DP baseline; asserts data_rank == rank//2, SP-pair loss identity, per-data_rank parity - _runners/hf_sp.py: standalone SFT-SP runner writing per-rank loss trajectories + mesh facts as JSON --------- Co-authored-by: clc <clc0301@cmbchina.com>
Collaborator
|
是不是选错分支了 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR type
PR information
Write the detail information belongs to this PR.
Experiment results
Paste your experiment result here(if needed).
jiayipeng@99-1-237-42 ms-swift % python -m pytest
swift/dev/tests/component/config/test_kernel_config.py
swift/dev/tests/component/model/test_kernel.py
==================================================================== test session starts =====================================================================
platform darwin -- Python 3.11.8, pytest-9.1.1, pluggy-1.6.0
rootdir: /Users/jiayipeng/ms-swift
configfile: pyproject.toml
plugins: anyio-4.15.1
collected 3 items
swift/dev/tests/component/config/test_kernel_config.py .. [ 66%]
swift/dev/tests/component/model/test_kernel.py . [100%]
===================================================================== 3 passed in 4.19s ======================================================================