Commit 1a578d1
committed
Fix TORCHAO_SKIP_LOADING_SO_FILES behavior (#3189)
**Summary:** Today, if users want to force skip loading the .so
files, they can pass in `TORCHAO_SKIP_LOADING_SO_FILES=1`.
However, if they pass in `TORCHAO_SKIP_LOADING_SO_FILES=0` or
`TORCHAO_SKIP_LOADING_SO_FILES=false`, we will still skip loading
these files. This commit fixes this behavior by:
1. Renaming this env var to `TORCHAO_FORCE_SKIP_LOADING_SO_FILES`
2. Only accepting value of "1" for this env var
**Test Plan:**
```
$ TORCHAO_FORCE_SKIP_LOADING_SO_FILES=1 python -c "import torchao"
Skipping import of cpp extensions due to TORCHAO_FORCE_SKIP_LOADING_SO_FILES=1
\# No effect
$ TORCHAO_FORCE_SKIP_LOADING_SO_FILES=0 python -c "import torchao"
$ TORCHAO_FORCE_SKIP_LOADING_SO_FILES=False python -c "import torchao"
$ TORCHAO_FORCE_SKIP_LOADING_SO_FILES=false python -c "import torchao"
```1 parent 937e3a4 commit 1a578d1
1 file changed
+14
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
49 | 52 | | |
50 | | - | |
| 53 | + | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
| |||
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
87 | 95 | | |
88 | 96 | | |
89 | 97 | | |
| |||
0 commit comments