Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile API README.md #1056

Merged
merged 1 commit into from
Jul 30, 2024
Merged
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
22 changes: 22 additions & 0 deletions src/onediff/infer_compiler/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# OneDiff compiler for inference

## With nexfort compiler backend
### Installation
1. Install nexfort: https://github.com/siliconflow/onediff?tab=readme-ov-file#nexfort
2. Install onediff: https://github.com/siliconflow/onediff?tab=readme-ov-file#3-install-onediff

### Usage
```python
from onediff.infer_compiler import compile

# module is the model you want to compile
options = '{"mode": "O3"}' # mode can be O2 or O3
compiled = compile(module, backend="nexfort", options=options)
```

### Suggested Modes

| Combination | Description |
| - | - |
| `O2` | This is the most suggested combination of compiler modes. This mode requires support for most models, ensuring model accuracy, and supporting dynamic resolution. |
| `O3` | This aims for efficiency. |