測試說明¶
測試(位於 fbgemm_gpu/experimental/gen_ai/test/ 目錄)和基準測試(位於 fbgemm_gpu/experimental/gen_ai/bench/ 目錄)提供瞭如何使用 FBGEMM GenAI 運算元的良好示例。
設定 FBGEMM GenAI 測試環境¶
構建/安裝 FBGEMM GenAI 包後,需要安裝額外的包才能正確執行測試
# !! Run inside the Conda environment !!
# From the fbgemm_gpu/ directory
python -m pip install -r requirements_genai.txt
執行 FBGEMM GenAI 測試¶
在構建/安裝 FBGEMM GenAI 包後執行測試
# !! Run inside the Conda environment !!
# From the fbgemm_gpu/experimental/gen_ai/test/ directory
cd test
python -m pytest -v -rsx -s -W ignore::pytest.PytestCollectionWarning quantize/quantize_test.py
執行 FBGEMM GenAI 基準測試¶
執行基準測試
# !! Run inside the Conda environment !!
# From the fbgemm_gpu/experimental/gen_ai/bench/ directory
cd bench
python quantize_bench.py