Commit 1e935c4
authored
[PJRT] Fix ninja not found error while re-building the plugin (#19553)
If we want to build the PJRT CPU plugin, we'll run something like
```
pip install --no-deps -v ./integrations/pjrt/python_packages/iree_cpu_plugin/
```
It works well in the first run. But if we did some changes, and want to
run it the second time, some errors will appear: cmake cannot find the
ninja in the first run anymore because it's in a temp build environment
and removed after the first build is finished.
We can remove the build dir to solve this problem. But it will cause a
full rebuild, and is quite annoying : )
Since IREE compiler doesn't have such issue so I checked its build
script, and I found that it's solved via the function
`maybe_nuke_cmake_cache` in its
[setup.py](https://github.com/iree-org/iree/blob/76a7b893e4c62d52eae2c165bdb23952a8589689/compiler/setup.py#L177).
So I copy it into setup.py of the PJRT plugin and did some modification:
- I think the PJRT plugin doesn't rely on CPython API (although it
builds a shared library) so we don't need to pin Python version;
- the build dir should be passed via a parameter since we have plugins
for different platforms (cpu/cuda/rocm..).
Also, I used this chance to add `cmake` to build dependencies, in case
of some users don't have cmake installed in the system.
ci-exactly: build_packages, test_pjrt
Signed-off-by: PragmaTwice <[email protected]>1 parent c2d408f commit 1e935c4
File tree
5 files changed
+41
-0
lines changed- integrations/pjrt/python_packages
- _setup_support
- iree_cpu_plugin
- iree_cuda_plugin
- iree_rocm_plugin
- iree_vulkan_plugin
5 files changed
+41
-0
lines changedLines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
124 | 160 | | |
125 | 161 | | |
126 | 162 | | |
| |||
131 | 167 | | |
132 | 168 | | |
133 | 169 | | |
| 170 | + | |
134 | 171 | | |
135 | 172 | | |
136 | 173 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
0 commit comments