Skip to content

Conversation

@joerunde
Copy link
Collaborator

@joerunde joerunde commented Oct 15, 2025

Description

Popping in vllm's current pre-config setup, seeing how easy it'd be to replace our current setup with this


Update:

Using prek instead of pre-commit (prek is a much faster Rust based swap-in for pre-commit)

@joerunde joerunde marked this pull request as draft October 15, 2025 21:40
Signed-off-by: Joe Runde <[email protected]>
Signed-off-by: Joe Runde <[email protected]>
@joerunde
Copy link
Collaborator Author

pre-commit seems to work slick!

The diff from actually swapping here is pretty hefty tho

pyproject.toml Outdated
# Allow lines to be as long as 80.
line-length = 80
# Use widescreen monitors 😎😎😎
line-length = 120
Copy link
Collaborator

Choose a reason for hiding this comment

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

not sure how that'll look with folks using laptop only :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

lol yeah I wanted to see what the negative diff here is and it's like 600 lines of savings

It seems pretty fine on my laptop screen, but let me know what you think!

Copy link
Collaborator

Choose a reason for hiding this comment

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

I like 120 for my local dev, but when looking at GitHub PR diffs side-by-side, the 80 character line limit seems to work better. With 120 character, Github needs to wrap those lines and then Python's semantic indentation gets lost and it's harder to track context when reading the code changes.

Copy link
Collaborator

@ckadner ckadner left a comment

Choose a reason for hiding this comment

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

Overall this seems to be a positive change. Maybe we can tweak some of our code conventions a little bit and allow a bit more freedom in favor of code readability in some places.

str(max_num_seqs),
"--compile_dynamic_sendnn",
"--attention_type",
attn_type,
Copy link
Collaborator

@ckadner ckadner Oct 17, 2025

Choose a reason for hiding this comment

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

This does not occur often, but in cases like this one I would favor readability over consistency and compactness (or line width) to group parameter names and values on one line (if the code formatting police allows it)

    inference_py_args = [
        sys.executable, "scripts/inference.py",
        "--architecture", "hf_pretrained",
        "--model_path", model_path,
        "--tokenizer", model_path,
        "--unfuse_weights", 
        "--device_type", "aiu",
        "--compile",
        "--cast_bf16_to_fp16", 
        "--compile_dynamic",
        "--min_pad_length", "64",
        "--max_new_tokens", "5",
        "--batch_size", str(max_num_seqs),
        "--compile_dynamic_sendnn",
        "--attention_type", attn_type

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We'd probably have to add inline comments that turn off the formatting for a specific block, but yeah I agree that what you posted here is much more readable than either the pre or post diff here

ignore_eos=True)
params0 = SamplingParams(max_tokens=5, temperature=0, logprobs=0, ignore_eos=True)
params1 = SamplingParams(max_tokens=10, temperature=0, logprobs=0, ignore_eos=True)
params2 = SamplingParams(max_tokens=7, temperature=0, logprobs=0, ignore_eos=True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍🏻 this is better than before

sampling_params = sampling_params_1k + sampling_params_2k + \
sampling_params_4k + sampling_params_8k + sampling_params_16k + \
sampling_params_32k
sampling_params = (
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice

pyproject.toml Outdated
# Allow lines to be as long as 80.
line-length = 80
# Use widescreen monitors 😎😎😎
line-length = 120
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here is an example of readability getting worse at least when looking at Github diffs:

image

or here

image

@maxdebayser
Copy link
Collaborator

I agree with @ckadner's assessment. Overall it's positive, but 120 character lines seem to make diffs more difficult to read.

@vllm-project vllm-project deleted a comment from github-actions bot Nov 12, 2025
@ckadner
Copy link
Collaborator

ckadner commented Nov 12, 2025

@joerunde -- I swapped out pre-commit in favor of prek. And I had to make a few extra changes to get the markdown linter to collaborate.

Trying to merge the changes from main next.

Signed-off-by: Christian Kadner <[email protected]>

# Conflicts:
#	tests/aftu/graph_compare_utils.py
#	tests/aftu/test_compare_graphs.py
#	tests/e2e/test_sampling_params.py
#	tests/golden_token_injector.py
#	tests/llm_cache.py
#	tests/output_util.py
#	tests/spyre_util.py
#	tests/utils/test_model_config_validator.py
#	tests/v1/worker/test_spyre_input_batch.py
#	vllm_spyre/config/runtime_config_validator.py
#	vllm_spyre/envs.py
#	vllm_spyre/platform.py
#	vllm_spyre/v1/sample/spyre_logits_processor.py
#	vllm_spyre/v1/worker/spyre_input_batch.py
#	vllm_spyre/v1/worker/spyre_worker.py
Signed-off-by: Christian Kadner <[email protected]>
@ckadner
Copy link
Collaborator

ckadner commented Nov 13, 2025

Seems to work with prek. Still need to clean up some of the dependencies, tools, workflows and checks we would no longer need.

@ckadner ckadner self-assigned this Nov 13, 2025
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.

5 participants