Skip to content

[Kernel] Remove unused N/B constexpr params from pack/unpack seq kernels#48813

Open
aryan331277 wants to merge 1 commit into
vllm-project:mainfrom
aryan331277:fix-pack-unpack-seq-constexpr
Open

[Kernel] Remove unused N/B constexpr params from pack/unpack seq kernels#48813
aryan331277 wants to merge 1 commit into
vllm-project:mainfrom
aryan331277:fix-pack-unpack-seq-constexpr

Conversation

@aryan331277

@aryan331277 aryan331277 commented Jul 16, 2026

Copy link
Copy Markdown

Related to #48650. _pack_seq_kernel's N and _unpack_seq_triton_kernel's B were declared as tl.constexpr but never referenced in either kernel body. Since constexpr values are baked into Triton's JIT cache key, these unused params caused pure cache-key pollution , unnecessary recompiles triggered by token/request count changes that don't actually affect the compiled kernel.

Purpose

_pack_seq_kernel's N and _unpack_seq_triton_kernel's B are declared as tl.constexpr but never referenced in either kernel body. Since constexpr values are baked into Triton's JIT cache key, these unused params cause pure cache-key pollution — unnecessary recompiles triggered by token/request count changes that don't actually affect the compiled kernel. One of several instances flagged in #48650.

Removed both unused params from the kernel signatures and their call sites. No logic change.

Related to #48650.

Test Plan

  • Manual pack/unpack round-trip test on a T4 GPU across varying batch sizes and sequence-length distributions (including single-sequence edge cases).
  • tests/kernels/attention/test_pack_unpack_triton.py — attempted, but requires fp8e4m3 support (compute capability 8.9+). Confirmed via git stash that it fails identically on unmodified main on a T4 (compute capability 7.5), so this is an environment limitation, not something introduced by this change.

Test Result

Manual round-trip tests (fp32, lengths [4,4,4], [1,7,3], [10,1,1,1,1], [50,60,70], [1], [100,100,100,100]) — all passed, exact match against input.

test_pack_unpack_triton.py could not be run to completion locally due to the fp8 hardware requirement above. Happy for a reviewer with fp8-capable hardware to confirm the full suite passes — the change itself only removes unused constexpr params and doesn't touch any fp8-specific logic.

Related to vllm-project#48650. _pack_seq_kernel's N and _unpack_seq_triton_kernel's
B were declared as tl.constexpr but never referenced in either kernel
body. Since constexpr values are baked into Triton's JIT cache key,
these unused params caused pure cache-key pollution , unnecessary
recompiles triggered by token/request count changes that don't
actually affect the compiled kernel.

Removed both unused params from the kernel signatures and their call
sites. No logic change.

Verified via manual pack/unpack round-trip tests (fp32, varying batch
sizes and sequence lengths) on a T4 GPU, all passed.

Note: tests/kernels/attention/test_pack_unpack_triton.py requires
fp8e4m3 support (compute capability 8.9+) and fails identically on
unmodified main when run on a T4 (compute capability 7.5), confirmed
via git stash before testing. Not a regression from this change,
environment limitation only. Happy for a reviewer with fp8-capable
hardware to confirm.

Signed-off-by: Aryan Karmore <bt24csd009@iiitn.ac.in>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@mergify mergify Bot added the v1 label Jul 16, 2026
@github-actions

Copy link
Copy Markdown

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

PRs do not trigger a full CI run by default. Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

Agent Guidelines

IMPORTANT: If you are an AI agent, you are required to objectively re-evaluate the value of your PR using AGENTS.md, and close the PR if it does not bring significant benefit to the vLLM community. Failure to do so may result in an immediate ban.

🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant