Skip to content

[Feat/Fix] Refactoring Llava models into single file - #475

Merged
merrymercy merged 2 commits into
sgl-project:mainfrom
Luodian:main
May 26, 2024
Merged

merrymercy merged 2 commits into
sgl-project:mainfrom
Luodian:main

Conversation

@Luodian

@Luodian Luodian commented May 26, 2024

Copy link
Copy Markdown
Contributor

This PR includes the addition of new model classes for handling different configurations.

Key Changes

  1. Introduced LlavaQwenForCausalLM and LlavaMistralForCausalLM classes, extending the LlavaLlamaForCausalLM with specific configurations for Qwen2 and Mistral models respectively.

  2. Modified the model_runner.py to refactor the entry class definition to To support multiple model classes in one module (we make different llava with different llms into one module to clean the code).

Fix

  1. We fix small template issues in example usages of llava_qwen and llava_llama3 model

@Luodian

Luodian commented May 26, 2024

Copy link
Copy Markdown
Contributor Author

This is my test, after refactoring, llava_qwen and llava_llama3 works correctly. (please ignore the output of the template message, it's for debug and removed in commit.)

image image

@Luodian

Luodian commented May 26, 2024

Copy link
Copy Markdown
Contributor Author

@merrymercy @BabyChouSr @Qubitium

Thanks for maintaining such wonderful project. Please check this PR and feel free to give more suggestions, thanks!

@Luodian Luodian changed the title [Fix and Feat] Refactoring Llava models into single file [Feat/Fix] Refactoring Llava models into single file May 26, 2024
@merrymercy
merrymercy merged commit 2b605ab into sgl-project:main May 26, 2024
timethink pushed a commit to timethink/sglang that referenced this pull request Mar 9, 2025
vschandramourya pushed a commit to vschandramourya/sglang that referenced this pull request Feb 3, 2026
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
EdwardXuy pushed a commit to shun8686/sglang that referenced this pull request May 9, 2026
efschu added a commit to efschu/htsglang that referenced this pull request Aug 3, 2026
…ockstep max (two all-reduces per layer), barrier skew reported per candidate; zero-parameter skew prediction 27.6 vs 27.9 ms/1k measured; FP8 ladder byte-identical, INT8 honestly has no prefill lever on this rig; floor-explosion root = harness clock ramp (-> sgl-project#459/sgl-project#483)
efschu added a commit to efschu/htsglang that referenced this pull request Aug 3, 2026
… correct the §1.3 model, and make the sgl-project#431 guard non-blocking

Two commits:

test(sgl-project#483,sgl-project#459): sgl-project#483 ("check_regressions prices prefill on stale rates")
is REFUTED -- check_regressions already prices on the RESOLVED rates
(landed with sgl-project#475). What was actually missing was the PIN: the only test
calling the function is checkpoint-gated and skips in every hermetic run,
so a revert would be invisible. test_check_regressions_pricing_483.py is
the hermetic falsifier. Also makes the s12 harness honest: an absent
measurement is None, never 0.0 (a spec-off tick has no accept length, and
0.0 silently survives every arithmetic it enters); and any procedural
property a verdict rests on (warm-up discarded, draws back-to-back, gap
between draws) is recorded as a measured number in the artifact, not taken
on the harness's word -- the s12 warm-up draw ran for months and was
discarded silently, so a warmed-up point and a cold one wrote the same
file.

perf(sgl-project#517): names the actual decode-loop BAR1 collectives and corrects the
catalog's round model -- a decode round is NOT free of host-path
collectives (the belief the old model rested on). Per NEXTN round there
are 3 replay boundaries (the draft chain is one captured graph, not one
per step) and 5 host-path BAR1 broadcasts, all sgl-project#50 speculative
rank-agreement syncs, reaching barlink because a barlink boot never
constructs pynccl. Measured cost: the sgl-project#431 blocking status-word read costs
-9.22% decode TPS against the same-tree NCCL baseline; removing it
recovers +2.68%. Fix: the abort-guard status word is now read
asynchronously (non-blocking D2H + cudaEventQuery, returning what an
earlier check staged), trading reporting LATENCY for zero stream
synchronization per check -- detection is unaffected because ctlStatus is
sticky. SGLANG_BARLINK_BAR1_ABORT_MAX_LAG (default 4) bounds the
deferral with a can-fail proof; ..._ABORT_DEFER=0 restores the exact
pre-sgl-project#517 blocking behavior. NOTE_517_bar1_guard_desk.md has the full
model, desk-only (no GPU arm run yet -- ticketed).

Two real conflicts, both resolved by combining rather than choosing a
side:
- FEATURE_CATALOG.md §12 (same insertion-point pattern as every merge
  today): HEAD's "Verified carve-outs (sgl-project#514)" paragraph kept, this
  branch's two sgl-project#459 paragraphs ("absent measurement is None" /
  "procedural property must be in the artifact") appended after. Two
  OTHER hunks (the sgl-project#483-REFUTED note near §2, the "Guard cost" note near
  §7) landed with no conflict at all -- neither region had been touched
  since this branch's base.
- test/registered/unit/distributed/_bar1_marker_source.py: both HEAD (via
  sgl-project#514's earlier edits) and this branch carry DIFFERENT LINE_* pins into
  barlink.py/barlink_bar1.py, because each was written against its own
  version of those files. Neither side's numbers are correct once both
  sets of source edits are combined. Resolved by reading the ACTUAL
  post-merge source: grepped the real logger.info/logger.warning/raise
  RuntimeError call-start lines in the merged barlink.py and
  barlink_bar1.py (2236/2250/3207/810) and verified all four renderers
  execute correctly against them before committing -- not a textual
  merge of the two guesses.

All 17 catalog sections and every other additive paragraph verified
present.

Tests (CUDA_VISIBLE_DEVICES=99, PYTHONPATH pinned to this worktree):
- The five directly touched/new test files (_bar1_marker_source.py's
  renderers verified live against the real merged source, plus
  test_barlink_bar1_abort_431.py, test_barlink_bar1_abort_deferred_517.py,
  test_s12_harness_459.py, test_check_regressions_pricing_483.py): 67 + 7
  passed, 0 failed.
- test_s12_log_analyse.py specifically (s12_log_analyse.py is touched):
  same 4 pre-existing failures, unchanged (fixture-data-dependent, not
  source-code-dependent).
- test/registered/unit/distributed/ (full): 24 failed, 2206 passed,
  8 skipped, 723 subtests -- same 24 failing IDs as the established
  baseline, byte-identical.
- ruff check --select=F401,F821,UP037: clean.
- codespell: 7 hits, all confirmed pre-existing (a German prose sample
  string already in scripts/gpu_battery/s12_prefill_kurve.py and
  s14_decode_punkt.py at this branch's base, untouched by its diff).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants