Reduce Python overhead in the GPTQ column loop

Open
#16 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
python, pytorch

Research direction

Start with src/bitsmith/calib/gptq.py and trace the Python column loop and lazy-update blocks in gptq_quantize; compare the proposed torch.compile and Triton approaches. Read tests/unit/test_calib.py and run its GPTQ checks to establish the current results. Done means Qwen2.5-0.5B GPTQ is at least 3x faster with the same perplexity and results differing only by float rounding.

Written by the indexing model from the issue text.

Description

area: calibration enhancement performance

gptq_quantize loops over columns in Python. On a GPU this makes GPTQ CPU bound: during
the Qwen2.5 runs the GPU sat mostly idle while one CPU core ran at 100%.

Ideas: process each lazy-update block with torch.compile, or write the inner block
loop as a Triton kernel; the update between blocks is already a single matmul.

Files: src/bitsmith/calib/gptq.py, tests/unit/test_calib.py (results must not change
beyond float rounding)

Done when GPTQ on Qwen2.5-0.5B is at least 3x faster with the same perplexity.

Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from yashwanthdevavarapu/bitsmith

All issues in yashwanthdevavarapu/bitsmith

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.