测试说明¶
测试(位于 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