快捷方式

測試說明

測試(位於 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

文件

訪問 PyTorch 的全面開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深入教程

檢視教程

資源

查詢開發資源並解答您的疑問

檢視資源