Skip to content

misc: add pre-commit config - #637

Merged
Ying1123 merged 1 commit into
sgl-project:mainfrom
zhyncs:pre-commit
Jul 17, 2024
Merged

Ying1123 merged 1 commit into
sgl-project:mainfrom
zhyncs:pre-commit

Conversation

@zhyncs

@zhyncs zhyncs commented Jul 17, 2024

Copy link
Copy Markdown
Contributor

motivation: automate the format

cc @merrymercy @Ying1123 @hnyls2002

ref https://github.com/sgl-project/sglang/blob/main/scripts/format.sh

pip3 install pre-commit
cd sglang
pre-commit install .
pre-commit run --all-files
isort....................................................................Passed
black....................................................................Passed

@Ying1123 Ying1123 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Ying1123
Ying1123 merged commit 2e341cd into sgl-project:main Jul 17, 2024
@hnyls2002

Copy link
Copy Markdown
Collaborator

@zhyncs This tool is amazing!

@zhyncs
zhyncs deleted the pre-commit branch July 18, 2024 00:26
timethink pushed a commit to timethink/sglang that referenced this pull request Mar 9, 2025
cen121212 pushed a commit to cen121212/sglang that referenced this pull request Nov 10, 2025
<!-- Thank you for your contribution! Please follow these guidelines to
enhance your pull request. If anything is unclear, submit your PR and
reach out to maintainers for assistance. Join our Slack community at
https://slack.sglang.ai to discuss further. -->

## Motivation

<!-- Describe the purpose and goals of this pull request. -->

## Modifications

<!-- Detail the changes made in this pull request. -->

## Accuracy Tests

<!-- If this pull request affects model outputs (e.g., changes to the
kernel or model forward code), provide accuracy test results. -->

## Benchmarking and Profiling

<!-- If this pull request impacts inference speed, provide benchmarking
and profiling results. -->

## Checklist

- [ ] Format your code according to the [Format code with
pre-commit](https://docs.sglang.ai/developer_guide/contribution_guide.html#format-code-with-pre-commit).
- [ ] Add unit tests according to the [Run and add unit
tests](https://docs.sglang.ai/developer_guide/contribution_guide.html#run-and-add-unit-tests).
- [ ] Update documentation according to [Write
documentations](https://docs.sglang.ai/developer_guide/contribution_guide.html#write-documentations).
- [ ] Provide accuracy and speed benchmark results according to [Test
the
accuracy](https://docs.sglang.ai/developer_guide/contribution_guide.html#test-the-accuracy)
and [Benchmark the
speed](https://docs.sglang.ai/developer_guide/contribution_guide.html#benchmark-the-speed).
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 21, 2026
…ntory that changes its case

Step 0 of the D-first decision: inventory before design, design as composition.
The build decision stays with the user; this document does not preempt it.

The recommendation is not the one the task assumed, and the numbers are at the
head of the file. On the one vector-independent capacity measurement available
(the runtime's own profiled per-rank capacity at uniform cell_size 32768,
[611344, 355784, 370952]), full page federation buys +1.45 percent over a
correctly solved static vector. Consuming the advisory the runtime already
prints on every boot buys +10.1 percent, which is about 87 percent of all
available gain, at essentially no cost. So D fails its own effort/benefit test
on page arithmetic, and its justification, if it is built, is the capital axis:
arming capital and KV-backing recovery cannot cross a rank boundary today.

That is measured, not argued. Over eight consecutive attempts a 127-164 MiB
staging shortfall on one rank stood the phase flip down permanently while about
4.7 GB sat stranded on the other two, after which long-context requests are
refused outright. All three ranks separately deferred KV-backing recovery
against their own local free figure. The min-binding is a pattern across
capacity, arming capital and backing recovery, not a single defect at the pool.

Two published loss estimates for this area, including one of my own, were
circular: capacities measured under a vector cannot judge that vector. Both are
withdrawn in the document rather than quietly dropped.

Inventory resolves the three delta hypotheses with file:line. The foreign-rank
allocator branch is absent (owner.py:429-437, :462-466; KvVmmArena is
single-device at kv_vmm_backing.py:484-491). The owner rule is a position
function with an unusually good seam: defined once at owner.py:24-29 with a
refresh registry at :58-89, but it has four consumers, not two - read, write,
HiCache (cache_controller.py:2187-2192) and spill
(kv_session_offload.py:474-494). Gather is solved on the head axis
(comm.py:166-217) and absent on the token axis (comm.py:314-327), with MLA hard
refused (comm.py:57-93).

Two corrections to the register's own inventory: sgl-project#637 "capture lines" is not
substantiated by any commit or comment, and the real graph-safety precedent is
kv_reshard.py:46-49 plus the owner.py refresh registry; page_size == 1 is a
hard gate (cache_controller.py:486-499), not a preference.

Also documented: every adaptive capacity mechanism in the fork is unarmed on
the recipe we ship, and the one capacity flag we do pass is what disables the
others, via three independent refusals each with a line. Nothing guards or
tests --enable-phase-flip together with --rank-kv-ratio corridor.

Six falsifiers are listed, each cheap, including the one the circularity
demands: a boot without --uneven-token-vector to obtain a capacity measurement
that is not contaminated by the vector being judged.

Documentation only. No code changes, no behaviour changes.
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.

3 participants