Skip to content

Conversation

DannyYuyang-quic
Copy link
Contributor

per-block observer for embedding quantization in QAT

script

# tokenizer.model & stories260K.pt:
wget "https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/stories260K.pt"
wget -O tokenizer.model "https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/tok512.model"

# tokenizer.bin:
python -m pytorch_tokenizers.tools.llama2c.convert -t tokenizer.model -o tokenizer.bin

# params.json: (only use 1 layer for demo)
echo '{"dim": 64, "n_layers": 1, "n_heads": 8, "n_kv_heads": 4, "vocab_size": 512, "multiple_of": 4, "max_seq_len": 512}' > params.json

# Run script
python -m examples.qualcomm.oss_scripts.llama.llama -b build-android -m ${soc} -s ${device_id} --prompt "Once upon a time" --decoder_model stories260k --model_mode ${model_mode} --max_seq_len 1024 art . --checkpoint stories260K.pt --params params.json --tokenizer_bin tokenizer.bin --tokenizer_model tokenizer.model
image

Copy link

pytorch-bot bot commented Sep 19, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/14431

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 5843174 with merge base 246009b (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 19, 2025
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@facebook-github-bot
Copy link
Contributor

@billmguo has imported this pull request. If you are a Meta employee, you can view this in D82827424.

@DannyYuyang-quic DannyYuyang-quic changed the title block quant observer for embedding QAT draft [Do not merge] block quant observer for embedding QAT draft Sep 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants