File size: 1,670 Bytes
64100c9
 
 
 
 
 
 
 
 
 
 
 
 
 
45f19e8
 
 
 
 
a04cf66
64100c9
 
45f19e8
a04cf66
e16ea9c
 
 
 
a04cf66
 
 
64100c9
 
 
 
 
 
 
2632610
 
64100c9
2632610
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
license: mit
---

Windows wheels of [NATTEN](https://github.com/SHI-Labs/NATTEN)

Original Doc (only install, no wheel): [Buid with MSVC](https://github.com/SHI-Labs/NATTEN/blob/main/docs/install.md#Build-with-MSVC) 

Build wheel steps
- First clone NATTEN, and make sure to fetch all submodules
```
git clone --recursive https://github.com/SHI-Labs/NATTEN
cd NATTEN
```
- Switch tag branch, such as `v0.17.3` (you can get latest tag by `git describe --tags` or list all available tags by `git tag -l`)

```
git checkout -b v0.17.3 v0.17.3
```

- Download WindowsWhlBuilder.bat into `NATTEN`

- To build with MSVC, please open the "Native Tools Command Prompt for Visual Studio". The exact name may depend on your version of Windows, Visual Studio, and cpu architecture (in my case it was "x64 Native Tools Command Prompt for VS 2022".)

  My Visual Studio Installer version

  ![image/png](https://cdn-uploads.huggingface.co/production/uploads/662db5cd34f94a2b82f317b0/nCCBd7_MYr1PrYZOrEnQw.png)
  
- Switch python env and make sure the corresponding torch cuda version is installed

- Start task
```
# Build with 1/4th of the number of processor threads on your system
WindowsWhlBuilder.bat build 

# Build with 8 parallel workers
WindowsWhlBuilder.bat build WORKERS=8

# Build targeting SM80 (I use this. You can also add WORKERS paramter)
WindowsWhlBuilder.bat build CUDA_ARCH=8.0
```
- Wheel file will be placed in the `dist` directory
- Test
  - Install natten
    ```
    cd dist
    # replace your real wheel name
    pip install natten_wheel_name
    ```
  - Return NATTEN work path and run test case
    ```
    cd ..
    WindowsWhlBuilder.bat test
    ```