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

ZIR-177: Progress towards keccak codegen #38

Merged
merged 8 commits into from
Sep 28, 2024
Merged

ZIR-177: Progress towards keccak codegen #38

merged 8 commits into from
Sep 28, 2024

Conversation

shkoo
Copy link
Contributor

@shkoo shkoo commented Sep 19, 2024

  • Add //zirgen/Main:gen_zirgen that compiles .zir and splits out generated files that are split out instead of all in one big file
  • Split out a bunch of zirgen driver.cpp to ease reuse by gen_zirgen
  • Add zirgen support to build_circuit and bootstrap utility
  • //zirgen/circuit filegroup target to build all circuits for faster cargo bootstrap build time
  • Standardize --output-dir command line option for building circuits target directory
  • Add a literal handler to codegen options to allow configuration of how literals are handled without having the codegen emitter depend on all the dialects
  • Change EDSL to separate out layouts for different buffers
  • Remove zkpLayoutCompat code generation option
  • Remove fallbackEmitLiteral in favor of literal handler syntax
  • Migrate more generators to use the literal handlers
  • Remove no longer used literal-creation macros
  • Remove special "context argument" types that have to be passed around everywhere; this is now configured per language per operation by add{Func,Call}ContextArg.
  • generated code now exposes API via buffers instead of layouts
  • Unconstrain arguments on StepFuncOp, Validity*FuncOp so we can add buffers to them
  • New LowerStepsFunc pass which converts all functions to StepFuncOps; in the future we should consider whether we want to keep the difference between back and exec functions.
  • New BuffersToArgs pass which transforms zstruct.get_buffer calls to function arguments
  • CodegenEmitter support for emitting to multiple files with the same emitter, avoiding duplicates of e.g. typedefs
  • Upgrade risc0 cargo reference to new revision on pending branch for layout changes

@github-actions github-actions bot changed the title Progress towards keccak codegen ZIR-177: Progress towards keccak codegen Sep 19, 2024
* Add //zirgen/Main:gen_zirgen that compiles .zir and splits out generated files that are split out instead of all in one big file
* Split out a bunch of zirgen driver.cpp to ease reuse by gen_zirgen
* Add zirgen support to build_circuit and bootstrap utility
* //zirgen/circuit filegroup target to build all circuits for faster `cargo bootstrap` build time
* Standardize --output-dir command line option for building circuits target directory
@shkoo shkoo marked this pull request as ready for review September 19, 2024 21:06
* Add a `literal handler` to codegen options to allow configuration of how literals are handled without having the codegen emitter depend on all the dialects
* Change EDSL to separate out layouts for different buffers
* Migrate more generators to use the literal handlers
* Remove no longer used literal-creation macros
… everywhere

* This is now configured per language per operation by add{Func,Call}ContextArg.
* We no longer need to copy around these useless context values everywhere in the IR
@shkoo shkoo requested a review from tzerrell September 26, 2024 16:44
* Unconstrain arguments on StepFuncOp, Validity*FuncOp so we can add buffers to them
* New LowerStepsFunc pass which converts all functions to StepFuncOps; in the future we should consider whether we want to keep the difference between back and exec functions.
* New BuffersToArgs pass which transforms zstruct.get_buffer calls to function arguments
* CodegenEmitter support for emitting to multiple files with the same emitter, avoiding duplicates of e.g. typedefs
* Upgrade risc0 to new revision on pending branch for layout changes
Copy link
Member

@tzerrell tzerrell left a comment

Choose a reason for hiding this comment

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

Your other reviewers might be able to give more informed opinions, but to me at least this looks good!

zirgen/Dialect/ZHLT/IR/ComponentOps.td Outdated Show resolved Hide resolved
@shkoo shkoo merged commit 93cce0a into main Sep 28, 2024
8 checks passed
@shkoo shkoo deleted the nils/main branch September 28, 2024 01:30
tzerrell added a commit that referenced this pull request Oct 15, 2024
* Progress towards keccak codegen

* Add //zirgen/Main:gen_zirgen that compiles .zir and splits out generated files that are split out instead of all in one big file
* Split out a bunch of zirgen driver.cpp to ease reuse by gen_zirgen
* Add zirgen support to build_circuit and bootstrap utility
* //zirgen/circuit filegroup target to build all circuits for faster `cargo bootstrap` build time
* Standardize --output-dir command line option for building circuits target directory

* Remove zkpLayoutCompat code generation option

* Add a `literal handler` to codegen options to allow configuration of how literals are handled without having the codegen emitter depend on all the dialects
* Change EDSL to separate out layouts for different buffers

* Remove fallbackEmitLiteral in favor of `literal handler` syntax

* Migrate more generators to use the literal handlers
* Remove no longer used literal-creation macros

* Remove special "context argument" types that have to be passed around everywhere

* This is now configured per language per operation by add{Func,Call}ContextArg.
* We no longer need to copy around these useless context values everywhere in the IR

* Zirgen: generated code exposes API via buffers instead of layouts

* Unconstrain arguments on StepFuncOp, Validity*FuncOp so we can add buffers to them
* New LowerStepsFunc pass which converts all functions to StepFuncOps; in the future we should consider whether we want to keep the difference between back and exec functions.
* New BuffersToArgs pass which transforms zstruct.get_buffer calls to function arguments
* CodegenEmitter support for emitting to multiple files with the same emitter, avoiding duplicates of e.g. typedefs
* Upgrade risc0 to new revision on pending branch for layout changes

* Update zirgen/Dialect/ZHLT/IR/ComponentOps.td

Co-authored-by: Tim Zerrell <tim.zerrell@gmail.com>

* Update risc0 dependency now that branch has merged

---------

Co-authored-by: Tim Zerrell <tim.zerrell@gmail.com>
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