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