diff --git a/docs/user-guide/development.md b/docs/user-guide/development.md index b3ca571b..625fa534 100644 --- a/docs/user-guide/development.md +++ b/docs/user-guide/development.md @@ -122,16 +122,24 @@ python -m pytest -q benchmarks/tests # benchmark infrastructure pre-commit run --all-files # lint, the same as CI's pre-commit check ``` -Two more run the suite on a PrivateUse1 test backend that `tests.privateuse1` builds, and -need a host C++ compiler: +More run the suite on a PrivateUse1 test backend that `tests.privateuse1` builds, and +need a host C++ compiler. `tests.privateuse1.target` adds the `tileops_test` target, whose +kernel for each op computes that op's reference on the test device: ```bash python -m pytest -q -p tests.privateuse1 --tileops-device=tileops_test \ tests benchmarks/tests --ignore=tests/ops # the portable tests +python -m pytest -q -p tests.privateuse1.target --tileops-device=tileops_test \ + --tileops-target=tileops_test -m smoke tests/ops # the tests/ops smoke tests python -m pytest -q -p tests.privateuse1 --tileops-device=tileops_test \ - --tileops-cuda-only-must-fail tests # every cuda_only test fails off CUDA + --tileops-cuda-only-must-fail tests --ignore=tests/ops # every cuda_only test fails off CUDA +python -m pytest -q -p tests.privateuse1.target --tileops-device=tileops_test \ + --tileops-target=tileops_test --tileops-cuda-only-must-fail tests/ops ``` +Under the target, a test whose op call the target does not serve is reported unvalidated. +Set `OMP_NUM_THREADS=1` when running these with `-n`. + ## Running benchmarks { #bench } ```bash diff --git a/docs/user-guide/development.zh.md b/docs/user-guide/development.zh.md index a70dfe8d..aaae6252 100644 --- a/docs/user-guide/development.zh.md +++ b/docs/user-guide/development.zh.md @@ -101,15 +101,21 @@ python -m pytest -q benchmarks/tests # benchmark 基础设施 pre-commit run --all-files # 代码检查,与 CI 中的 pre-commit 一项相同 ``` -另有两项在 `tests.privateuse1` 构建的 PrivateUse1 测试 backend 上运行测试,需要主机上的 C++ 编译器: +以下几项在 `tests.privateuse1` 构建的 PrivateUse1 测试 backend 上运行测试,需要主机上的 C++ 编译器。`tests.privateuse1.target` 另外注册 `tileops_test` target,它为每个 op 构建的 kernel 在测试设备上计算该 op 的 reference: ```bash python -m pytest -q -p tests.privateuse1 --tileops-device=tileops_test \ tests benchmarks/tests --ignore=tests/ops # 可移植的测试 +python -m pytest -q -p tests.privateuse1.target --tileops-device=tileops_test \ + --tileops-target=tileops_test -m smoke tests/ops # tests/ops 的 smoke 测试 python -m pytest -q -p tests.privateuse1 --tileops-device=tileops_test \ - --tileops-cuda-only-must-fail tests # 每个 cuda_only 测试在 CUDA 之外都失败 + --tileops-cuda-only-must-fail tests --ignore=tests/ops # 每个 cuda_only 测试在 CUDA 之外都失败 +python -m pytest -q -p tests.privateuse1.target --tileops-device=tileops_test \ + --tileops-target=tileops_test --tileops-cuda-only-must-fail tests/ops ``` +在这个 target 下,op 调用不被 target 服务的测试报告为 unvalidated。用 `-n` 并行运行时设置 `OMP_NUM_THREADS=1`。 + ## 运行 benchmark { #bench } ```bash