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

expand README.md #124

Merged
merged 4 commits into from
Sep 17, 2024
Merged

expand README.md #124

merged 4 commits into from
Sep 17, 2024

Conversation

superlopuh
Copy link
Contributor

These are the notes I took, as well as the existing README. Could you please double-check that the information is correct, and let me know if anything needs to changed?

CC @compor

@superlopuh superlopuh requested a review from zero9178 August 30, 2024 14:06
@superlopuh superlopuh self-assigned this Aug 30, 2024
README.md Outdated
Comment on lines 25 to 26
The docker toolchain needs to be in sync with the snitch runtime, as the hardware gets continuously updated.
When updating the snitch runtime submodule, the docker image needs to be updated with the new commit hash to make sure the hardware and software are in sync.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be either a duplicate sentence

README.md Outdated
The docker toolchain needs to be in sync with the snitch runtime, as the hardware gets continuously updated.
When updating the snitch runtime submodule, the docker image needs to be updated with the new commit hash to make sure the hardware and software are in sync.

The easiest way to iterate on the docker image is to develop on it locally, and then pushing it to GitHub, which will detect that the toolchain directory is changed, and will release a new image automatically.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The easiest way to iterate on the docker image is to develop on it locally, and then pushing it to GitHub, which will detect that the toolchain directory is changed, and will release a new image automatically.
The easiest way to iterate on the docker image is to develop on it locally, and then push the changes to GitHub, which will detect that the toolchain directory is changed, and will release a new image automatically.

README.md Outdated
## Compiling Neural Networks

Any information you can find on how to use `iree-compile` is applicable, with the only major difference bing the `--iree-hal-target-backends=llvm-cpu`, which also supports our `quidditch` value for the flag, which leverages our flow.
The inputs to `iree-compile` are all `.mlir` files, so you need to somehow get the file, [here's](https://iree.dev/guides/deployment-configurations/cpu/#compile-and-run-a-program) the guide on how to get one.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The inputs to `iree-compile` are all `.mlir` files, so you need to somehow get the file, [here's](https://iree.dev/guides/deployment-configurations/cpu/#compile-and-run-a-program) the guide on how to get one.
The inputs to `iree-compile` are all `.mlir` files, so you need to somehow get the file, [here's](https://iree.dev/guides/ml-frameworks/) the guide on how to get one.

is probably the better link

README.md Outdated

The PyTorch flow uses [iree-turbine](https://github.com/iree-org/iree-turbine), which is included in the virtualenv of the Docker container.
We use it to compile nsnet2 (`runtime/samples/nsnet2/NsNet2.py`).
The MLIR file extracted this way is that it will contain functions that are named the same as the Python model functions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The MLIR file extracted this way is that it will contain functions that are named the same as the Python model functions.
The MLIR file extracted this way will contain functions that are named the same as the Python model functions.

README.md Outdated

The `quiddtch_module` macro in the `CMakeLists.txt` turns the MLIR file into an executable.
`ASSERT_XDSL` is a flag that will error out if xDSL micro-kernel compilation fails.
This macro creates an executable called `mynewmodel` (removing the `.mlir` suffix).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This macro creates an executable called `mynewmodel` (removing the `.mlir` suffix).
This macro creates a library called `mynewmodel` (removing the `.mlir` suffix).

README.md Outdated
4. The cmake build system mirrors your source directory, so if you added `runtime/samples/mynewmodel/`, the build location will be `build/runtime/samples/mynewmodel`.
5. Add your new executable to `tests/CMakeLists.txt`

> NB. you can override the compilation with xDSL by adding `LLVM` to the `uidditch_module` macro, which overrides the XDSL pipeline entirely and just computes everything with stock IREE `llvm-cpu` target.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> NB. you can override the compilation with xDSL by adding `LLVM` to the `uidditch_module` macro, which overrides the XDSL pipeline entirely and just computes everything with stock IREE `llvm-cpu` target.
> NB. you can override the compilation with xDSL by adding `LLVM` to the `quidditch_module` macro, which overrides the XDSL pipeline entirely and just computes everything with stock IREE `llvm-cpu` target.


## Quidditch Compiler Structure

All source code is in `codegen/compiler/src/Quirritch`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
All source code is in `codegen/compiler/src/Quirritch`.
All source code is in `codegen/compiler/src/Quidditch`.

README.md Outdated

`QuidditchTarget.cpp`

The QuidditchTargetBackend class sibclasses IREE::HAL::TargetBackend.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The QuidditchTargetBackend class sibclasses IREE::HAL::TargetBackend.
The QuidditchTargetBackend class subclasses IREE::HAL::TargetBackend.

README.md Outdated

### Dialect

There is currently only one dialect, `snitch`, which might be split up in the future.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
There is currently only one dialect, `snitch`, which might be split up in the future.
There is currently only one dialect, `quidditch_snitch`, which might be split up in the future.

@superlopuh superlopuh requested a review from zero9178 September 16, 2024 21:05
@zero9178 zero9178 merged commit 15935bf into main Sep 17, 2024
1 check passed
@zero9178 zero9178 deleted the sasha/readme-update branch September 17, 2024 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants