Lightning-AI/lightning-thunder

quantization: process tensors on meta device directly, maybe implement CPU quantization (if it is easy)

Open

#1,111 建立於 2024年9月6日

在 GitHub 查看
 (4 留言) (0 反應) (0 負責人)Python (114 fork)github user discovery
good first issuetransforms

倉庫指標

Star
 (1,460 star)
PR 合併指標
 (PR 指標待抓取)

描述

Currently the BitsAndBytesLinearQuant4bit for submodule always calls bitsandbytes.functional.quantize_4bit. This is somewhat touchy for CPU tensors because quantize_4bit only works on GPU tensors but it is outright not so nice for meta tensors, where we only would need to get the right shapes.

https://github.com/Lightning-AI/lightning-thunder/blob/e64d347def39bb47101efafe4177adf9f77a63ec/thunder/transforms/quantization.py#L93-L103

貢獻者指南