-
Notifications
You must be signed in to change notification settings - Fork 697
Add int4mm test to the CUDA CI flow #15181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d753f03
Add int4mm test to the CUDA CI flow
desertfire 8456310
Update optimum-executorch pin
desertfire fcbefe3
1. Test more quantization format
desertfire 95e2e51
Consolidate e2e workflows
desertfire d27e10a
Remove --qembedding
desertfire 8cd4c6a
Remove --qlinear as the produced result is invalid
desertfire 45cbb84
Consolidate export workflow
desertfire File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -275,6 +275,154 @@ jobs: | |
| exit 1 | ||
| fi | ||
|
|
||
| if [ $EXIT_CODE -ne 0 ]; then | ||
| echo "Unexpected exit code: $EXIT_CODE" | ||
| exit $EXIT_CODE | ||
| fi | ||
| echo "::endgroup::" | ||
|
|
||
| export-voxtral-cuda-quantized: | ||
| name: export-voxtral-cuda-quantized | ||
| uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
| secrets: inherit | ||
| strategy: | ||
| fail-fast: false | ||
| with: | ||
| timeout: 90 | ||
| secrets-env: EXECUTORCH_HF_TOKEN | ||
| runner: linux.g5.4xlarge.nvidia.gpu | ||
| gpu-arch-type: cuda | ||
| gpu-arch-version: 12.6 | ||
| use-custom-docker-registry: false | ||
| submodules: recursive | ||
| upload-artifact: voxtral-cuda-quantized-export | ||
| ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | ||
| script: | | ||
| set -eux | ||
|
|
||
| echo "::group::Setup ExecuTorch" | ||
| ./install_executorch.sh | ||
| echo "::endgroup::" | ||
|
|
||
| echo "::group::Setup Huggingface" | ||
| pip install -U "huggingface_hub[cli]" accelerate | ||
| huggingface-cli login --token $SECRET_EXECUTORCH_HF_TOKEN | ||
| OPTIMUM_ET_VERSION=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt) | ||
| pip install git+https://github.com/huggingface/optimum-executorch.git@${OPTIMUM_ET_VERSION} | ||
| pip install mistral-common librosa | ||
| pip list | ||
| echo "::endgroup::" | ||
|
|
||
| echo "::group::Export Voxtral with Quantization" | ||
| optimum-cli export executorch \ | ||
| --model "mistralai/Voxtral-Mini-3B-2507" \ | ||
| --task "multimodal-text-to-text" \ | ||
| --recipe "cuda" \ | ||
| --dtype bfloat16 \ | ||
| --device cuda \ | ||
| --max_seq_len 1024 \ | ||
| --qlinear 4w \ | ||
| --qlinear_encoder 4w \ | ||
| --qlinear_packing_format tile_packed_to_4d \ | ||
| --qlinear_encoder_packing_format tile_packed_to_4d \ | ||
| --output_dir ./ | ||
|
||
| python -m executorch.extension.audio.mel_spectrogram \ | ||
| --feature_size 128 \ | ||
| --stack_output \ | ||
| --max_audio_len 300 \ | ||
| --output_file voxtral_preprocessor.pte | ||
|
|
||
| test -f model.pte | ||
| test -f aoti_cuda_blob.ptd | ||
| test -f voxtral_preprocessor.pte | ||
| echo "::endgroup::" | ||
|
|
||
| echo "::group::Store Voxtral Quantized Artifacts" | ||
| mkdir -p "${RUNNER_ARTIFACT_DIR}" | ||
| cp model.pte "${RUNNER_ARTIFACT_DIR}/" | ||
| cp aoti_cuda_blob.ptd "${RUNNER_ARTIFACT_DIR}/" | ||
| cp voxtral_preprocessor.pte "${RUNNER_ARTIFACT_DIR}/" | ||
| ls -al "${RUNNER_ARTIFACT_DIR}" | ||
| echo "::endgroup::" | ||
|
|
||
| test-voxtral-cuda-quantized-e2e: | ||
desertfire marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| name: test-voxtral-cuda-quantized-e2e | ||
| needs: export-voxtral-cuda-quantized | ||
| uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
| strategy: | ||
| fail-fast: false | ||
| with: | ||
| timeout: 90 | ||
| runner: linux.g5.4xlarge.nvidia.gpu | ||
| gpu-arch-type: cuda | ||
| gpu-arch-version: 12.6 | ||
| use-custom-docker-registry: false | ||
| submodules: recursive | ||
| download-artifact: voxtral-cuda-quantized-export | ||
| ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | ||
| script: | | ||
| set -eux | ||
|
|
||
| echo "::group::Setup ExecuTorch Requirements" | ||
| CMAKE_ARGS="-DEXECUTORCH_BUILD_CUDA=ON" ./install_requirements.sh | ||
| pip list | ||
| echo "::endgroup::" | ||
|
|
||
| echo "::group::Prepare Voxtral Quantized Artifacts" | ||
| cp "${RUNNER_ARTIFACT_DIR}/model.pte" . | ||
| cp "${RUNNER_ARTIFACT_DIR}/aoti_cuda_blob.ptd" . | ||
| cp "${RUNNER_ARTIFACT_DIR}/voxtral_preprocessor.pte" . | ||
| TOKENIZER_URL="https://huggingface.co/mistralai/Voxtral-Mini-3B-2507/resolve/main/tekken.json" | ||
| curl -L $TOKENIZER_URL -o tekken.json | ||
| ls -al model.pte aoti_cuda_blob.ptd voxtral_preprocessor.pte tekken.json | ||
| echo "::endgroup::" | ||
|
|
||
| echo "::group::Download Test Audio File" | ||
| AUDIO_URL="https://github.com/voxserv/audio_quality_testing_samples/raw/refs/heads/master/testaudio/16000/test01_20s.wav" | ||
| curl -L $AUDIO_URL -o poem.wav | ||
| echo "::endgroup::" | ||
|
|
||
| echo "::group::Build Voxtral Runner" | ||
| cmake --preset llm \ | ||
| -DEXECUTORCH_BUILD_CUDA=ON \ | ||
| -DCMAKE_INSTALL_PREFIX=cmake-out \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -Bcmake-out -S. | ||
| cmake --build cmake-out -j$(( $(nproc) - 1 )) --target install --config Release | ||
|
|
||
| cmake -DEXECUTORCH_BUILD_CUDA=ON \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -Sexamples/models/voxtral \ | ||
| -Bcmake-out/examples/models/voxtral/ | ||
| cmake --build cmake-out/examples/models/voxtral --target voxtral_runner --config Release | ||
| echo "::endgroup::" | ||
|
|
||
| echo "::group::Run Voxtral Runner with Quantized Model" | ||
| set +e | ||
| export LD_LIBRARY_PATH=/opt/conda/lib:$LD_LIBRARY_PATH | ||
| OUTPUT=$(cmake-out/examples/models/voxtral/voxtral_runner \ | ||
| --model_path model.pte \ | ||
| --data_path aoti_cuda_blob.ptd \ | ||
| --tokenizer_path tekken.json \ | ||
| --audio_path poem.wav \ | ||
| --processor_path voxtral_preprocessor.pte \ | ||
| --temperature 0 2>&1) | ||
| EXIT_CODE=$? | ||
| set -e | ||
|
|
||
| echo "$OUTPUT" | ||
|
|
||
| if ! echo "$OUTPUT" | grep -iq "poem"; then | ||
| echo "Expected output 'poem' not found in output" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [ $EXIT_CODE -ne 0 ]; then | ||
| echo "Unexpected exit code: $EXIT_CODE" | ||
| exit $EXIT_CODE | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.