docs: QLoRA Documentation and Notebooks#3970
Conversation
80b5fab to
11360a1
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
b832e29 to
5745e3d
Compare
3681648 to
fa28505
Compare
9564816 to
bbbd1de
Compare
6863ae6 to
7946f45
Compare
7946f45 to
bf747b7
Compare
| To add weight mapping for vLLM decode: | ||
|
|
||
| 1. **Create a Weight Mapping Config**: | ||
| Create a new file in \[src/maxtext/integration/tunix/weight_mapping/\](../../src/maxtext/integration/tunix/weight_mapping/) (e.g., `your_model.py`) defining a mapping dataclass. You can refer to \[gemma3.py\](../../src/maxtext/integration/tunix/weight_mapping/gemma3.py) or \[llama3.py\](../../src/maxtext/integration/tunix/weight_mapping/llama3.py) as templates. |
There was a problem hiding this comment.
Our documentation is usually surfaced via https://maxtext.readthedocs.io/en/latest/index.html I am not sure that the hyperlinks to code in GitHub would work here. Please check how code links are implemented in other docs. We are also trying to keep docs consistent w.r.t. MaxText release versions. Such that if someone is reading docs for version 0.2.3, all hyperlinks also point to the same version.
@melissawm do you know how to correctly link to code in GitHub?
There was a problem hiding this comment.
Yes, these will not work. The readthedocs site can only see relative links to documents under the docs/ folder. To link to files under src/ or other folders, the best way is to use the github link (in this case, https://github.com/AI-Hypercomputer/maxtext/blob/main/src/maxtext/integration/tunix/weight_mapping/llama3.py)
| "\n", | ||
| " # Install uv, a fast Python package installer\n", | ||
| " !pip install uv\n", | ||
| " \n", |
There was a problem hiding this comment.
Please add this:
import os
os.environ["UV_TORCH_BACKEND"]="cpu"
| "if not epath.Path(MODEL_CHECKPOINT_PATH).exists():\n", | ||
| " # Install torch for the conversion script\n", | ||
| " print(\"Installing torch...\")\n", | ||
| " subprocess.run(\n", |
There was a problem hiding this comment.
I don't think we need to install torch for checkpoint conversion script anymore.
|
Hi @SurbhiJainUSC for the remaining issues you bring up I will modify in another PR and let you know. |
|
I have created a new PR #4277 to address the leftover comments in the |
|
I have also updated the branch in #4277 to resolve the ReadTheDocs relative links issue in |
Description
This PR adds comprehensive documentation and tutorials for running LoRA/QLoRA fine-tuning, specifically focusing on multi-host TPU environments.
As PEFT techniques become more prevalent for large models, users need clear, step-by-step guidance on how to leverage MaxText and Tunix for multi-host tuning.
This PR includes:
merging.
Tests
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.