Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions docs/user-guide/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions docs/user-guide/development.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading