Comments (6)
For example, any approach to control kernel_size of Conv2d to be in range [1, 15]?
One ad-hoc way would be to add something like cons.append(nnsmith_le(kernel_h_size, 15))
around here
nnsmith/nnsmith/abstract/op.py
Line 1424 in 7b793ff
from nnsmith.
Also, you might find the gist helpful: https://colab.research.google.com/drive/13LNQBvfpPFiaHWKnac6hxzvJY4LUAWWQ?usp=sharing
from nnsmith.
@jakc4103 You can try https://github.com/ise-uiuc/nnsmith/blob/main/doc/cli.md#add-extra-constraints with the latest nnsmith:
pip install "git+https://github.com/ise-uiuc/nnsmith@main#egg=nnsmith[torch,onnx]" --upgrade
Tks, this works.
from nnsmith.
Recall that conv2d only accepts 4-dimension inputs. Because the graph generation is randomized in a way to start with a placeholder that has a random rank, as a result, it must be lucky enough to start with 4
to be able to generate conv2d.
This should be fixed by adding an extra argument for configuring the rank (length of its shape dimensions) of the starter placeholder (WIP).
For adding extra constraints, because we don't want to bother users by editing the source code, there is a way to systematically patch constraints at user level with the patch_requires
decorator. See the TensorRT example:
nnsmith/nnsmith/backends/tensorrt.py
Line 151 in bdc2747
Probably something like:
@patch_requires(${THE_FACTORY_TYPE}$.system_name, "core.Pool2d")
def RulePool2d(self: AbsOpBase, _: List[AbsTensor]) -> List[Union[z3.BoolRef, bool]]:
return [self.kernel_h_size <= 15, self.kernel_w_size <= 15]
Meanwhile for some good randomness of shapes, try to use other method="symbolic-cinit"
in model_gen
:
gen = model_gen(
...
method: str = "symbolic-cinit", # or "concolic"
...
):
My apologies for the incomplete documentation and will be improving the doc soon (prob. next mon). For the rank issue there will be a patch soon and I will offer a colab example later today.
Meanwhile, for now please try to use the latest version with:
pip install "git+https://github.com/ise-uiuc/nnsmith@main#egg=nnsmith[torch,onnx]" --upgrade
This will provide a lot more features and possibly a better experience (in debugging etc.). Thanks!
from nnsmith.
@jakc4103 You can try https://github.com/ise-uiuc/nnsmith/blob/main/doc/cli.md#add-extra-constraints with the latest nnsmith:
pip install "git+https://github.com/ise-uiuc/nnsmith@main#egg=nnsmith[torch,onnx]" --upgrade
from nnsmith.
Feel free to reopen if you still encounter any issues on this.
from nnsmith.
Related Issues (20)
- [Tracking] Make Python >= 3.8 mandatory
- 💡 [Dynamic Graph] - Does nnsmith support dynamic graphs? HOT 3
- 💡 [REQUEST] TF Coverage Tutorial and Script
- TF Coverage Scripts and Tutorial HOT 1
- [Dev] `hydra` -> `click`
- [Question] Customize the number of input/output variables in generated graphs HOT 9
- 💡 [REQUEST] - Tutorial of adding a new operator for GIR HOT 4
- 🐛 [BUG] - <`ONNXModelCPU_tvm_0.9.0_cpu.yaml` file was empty, can't get opset properly properly> HOT 11
- Render seems to not work HOT 6
- 🐛 [BUG] - There is a problem with relative import in `fuzz.py` HOT 2
- Some questions about the replication of the experiment HOT 6
- Problems encountered while compiling the onnx model HOT 4
- [Help wanted] How to get the shape of the output tensor of a operator HOT 5
- [Help wanted] How to get the result of executing model_exec.py? HOT 7
- [User Question] integer type annotation in TVM HOT 2
- 🐛 [BUG] - <An error occurred when loading the onnx model generated by nnsmith using tvm.delay.> HOT 1
- [Help Wanted] Problems encountered when converting the onnx model to tvm.relay HOT 3
- [Help Wanted] How to only generate sequential models HOT 2
- Help Wanted - How does one generate minimum code examples from NNSmith bug reports HOT 3
- Instruction of TVM COV HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nnsmith.