Skip to content

Commit

Permalink
compile API README.md (#1056)
Browse files Browse the repository at this point in the history
  • Loading branch information
strint authored Jul 30, 2024
1 parent d066071 commit fc3de4e
Showing 1 changed file with 22 additions and 0 deletions.
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. |

0 comments on commit fc3de4e

Please sign in to comment.