-
Notifications
You must be signed in to change notification settings - Fork 47
Migrating to One-Shot Bufferization #1027
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
Closed
Closed
Changes from all commits
Commits
Show all changes
192 commits
Select commit
Hold shift + click to select a range
6af3eef
Setup latest dependency for new bufferization passes
tzunghanjuang 951ef36
enableRegionSimplification accepts GreedySimplifyRegionLevel type ins…
tzunghanjuang 21e5933
translateModuleToLLVMIR needs an extra disableVerification parameter
tzunghanjuang c8336bd
Replace equals with compare for llvm::StringRef
tzunghanjuang 9e6ae3f
Keep using jax 0.4.28 but update llvm (from jax 0.4.29)
tzunghanjuang 0cf462b
Roll back EnzymeStatic to 19
tzunghanjuang 39b2537
Use == instead of compare
tzunghanjuang 5bad741
Roll back enableRegionSimplification type
tzunghanjuang 4e9cc28
Comment out retired bufferization passes
tzunghanjuang ad22787
Temporarily disable finalizing-bufferization for debugging
tzunghanjuang add7ddd
Merge remote-tracking branch 'origin/main' into bufferization-update
tzunghanjuang be8c968
Merge remote-tracking branch 'origin/main' into bufferization-update
tzunghanjuang 0852bcc
Reformat compiler.py
tzunghanjuang ffcd4d3
Remove all passes and use one-shot-bufferize only
tzunghanjuang 8b45ae8
Add new buffer passes except for the deallocation pipeline
tzunghanjuang 4d20def
Temporarily set side effect of InitOp and FinalizeOp as zero
tzunghanjuang d9b38ba
Disable deallocation pipeline for debugging
tzunghanjuang 676053f
Draft Quantum Impl of BufferizableOpInterface
tzunghanjuang 3febbf7
Add empty one-shot-bufferize for quantum::ExtractOp
tzunghanjuang a354e3f
Temporarily get rid of memory error
tzunghanjuang 7de0d80
Register new one-shot bufferization pass
tzunghanjuang af6f65a
Fix include typos
tzunghanjuang 1edbcd2
Replace ExtractOP with StateOp for the first bufferization example
tzunghanjuang f94dcf7
Test StateOp bufferization
tzunghanjuang a3816a6
Use replaceOpWithBufferizedValues to get rid of segmentation fault
tzunghanjuang fc46399
Set buffer write for StateOp as false
tzunghanjuang f028709
Add new bufferization pass for ProbsOp
tzunghanjuang dc631a7
Add new bufferization interface for CountsOp
tzunghanjuang b8181b8
Correct the read flag for StateOp like operations
tzunghanjuang 849e884
Add new set_state bufferization
tzunghanjuang 39f1757
Add SetBasisStateOp bufferization
tzunghanjuang b5157ff
Add QubitUnitary Bufferization
tzunghanjuang 5556493
Add hermitian bufferization
tzunghanjuang c3bf61a
Add Hamiltonian bufferization
tzunghanjuang a9ed44b
Remove redundant scope resolutions
tzunghanjuang b54c104
Add SampleOp bufferization
tzunghanjuang 440b926
Draft bufferization templates for Catalyst and Gradient IRs
tzunghanjuang 159057c
Add printOp Bufferization
tzunghanjuang 81394ae
Fix indentation
tzunghanjuang e6df804
Remove redundant imclude from QuantumDialect
tzunghanjuang 980b0db
Fix the other indentations
tzunghanjuang 01df77e
Add CustomCall bufferization
tzunghanjuang 4a90eef
Set write flag of custom call as false
tzunghanjuang c4547ae
Tentatively add CallbackCallOp bufferization
tzunghanjuang 0c2eea8
Still create a new type converter in CallbackCallOp pass
tzunghanjuang 71fa5d7
Use replaceOpWithBufferizedValues at the end of CallbackCallOp
tzunghanjuang 4295bfc
Add new passes to quantum-opt
tzunghanjuang c01dd1f
Add AdjointOp bufferization
tzunghanjuang 45581c7
Use BufferizeTypeConverter in new pass
tzunghanjuang 9ba2cd9
Make CallbackOp use Unstructured Control Flow Bufferizable OpInterface
tzunghanjuang 58a0bed
Add tentative patch for moduleOp bufferization
tzunghanjuang f0a10bf
Update patch script
tzunghanjuang 03bee24
Reformatting
tzunghanjuang ba85b20
Update llvm patch
tzunghanjuang 1c730d2
Stick with old llvm version for now
tzunghanjuang 31c9139
Rollback llvvm fix
tzunghanjuang 525422b
Reformatting
tzunghanjuang d7c236d
Update patch
tzunghanjuang ac4fc89
Correct AdjointOpInterface
tzunghanjuang 4428eec
Fix bufferization in AjointOp
tzunghanjuang dde8e68
Add backpropOp bufferization
tzunghanjuang af0da0c
Add restrict to ToTensorOp
tzunghanjuang cae09e0
Correct bufferized args in backpropOp
tzunghanjuang 1182aca
Use identity-layout-map
tzunghanjuang 67d1d6a
Update llvm patch with new ReturnLike mechanism
tzunghanjuang c6d834c
Cleanup
tzunghanjuang f8a1a8f
Include convert-elementwise-to-linalg back to bufferization pass
tzunghanjuang 9a1a791
Add ForwardOp Bufferization
tzunghanjuang 3aead9c
Add reverseOp Bufferization
tzunghanjuang 418f122
Correct bufferization interface registration
tzunghanjuang 576ebe6
Rebuild MemRefType without memory layout for BackpropOp
tzunghanjuang 3c4056c
Add back convert-arraylist-to-memref
tzunghanjuang 68d6233
Include scf-for-preprocessing from LLVM PR#87594
tzunghanjuang 31b1dc9
Add scf-loop-bufferization-preprocessing into bufferization pass
tzunghanjuang 81f0a86
Make llvm patches apply to directory
tzunghanjuang ee9b78d
Remove functionOpInterface workaround for no ReturnLike from the patch
tzunghanjuang b9f0e9c
Make CopyGlobalMemRef create memref without memory layout and then ca…
tzunghanjuang c522097
Use allow-return-allocs-from-loops to avoid scf.for/while errors
tzunghanjuang 553ed3e
Make ForwardOp and ReverseOp compatible with ModuleOpBufferize
tzunghanjuang c418792
Make ForwardOp and ReverseOp update signature
tzunghanjuang 1e5f96c
Do not bufferize ForwarOp if its implementation if not bufferized
tzunghanjuang a2af457
Update ReverseOp
tzunghanjuang 723fa11
Update conditions for ForwardOp and ReverseOp
tzunghanjuang 49b197b
Remove ForwardOp and ReverseOp workarounds
tzunghanjuang 0d4bfbd
Create templates for ForwardOp and ReverseOp preprocessing
tzunghanjuang 79ce24e
Use preprocessing steps to add Func.call in ForwardOp and ReverseOp
tzunghanjuang 7d5fc1f
Remove llvm scf patch
tzunghanjuang 997b674
Merge branch 'main' into bufferization-update
6a24347
CI warning cleanup
tzunghanjuang 73bef19
Update llvm patch
tzunghanjuang 66e7b06
Make gradient.ReturnOp ReturnLike
tzunghanjuang ea4f2d7
Draft new ForwardOp bufferization
tzunghanjuang accf60a
Add getBufferType method to ForwardOp and ReverseOp Interface
tzunghanjuang 99c517a
Cleanup unused read-write flag in ForwardOp and ReverseOp
tzunghanjuang c7768be
Copy methods from FuncOp to ForwardOp and ReverseOp
tzunghanjuang 42d224a
Draft new ReverseOp Interface and fix its getBufferType
tzunghanjuang fedd668
Make ForwardOp and ReverseOp follow FuncOp bufferization steps
tzunghanjuang 0473d72
Make gradient-preprocess happen before eliminate-empty-tensors to pas…
tzunghanjuang f5c4da0
Reformatting
tzunghanjuang d42b123
Update llvm patch with FunctionArgTypeConverterFn
tzunghanjuang 86eeb4e
Preserve unused return types during bufferization
tzunghanjuang de97c6b
Use identity-layout-map to prevent unused returns from being removed
tzunghanjuang 42b3870
revert identiy-layout-map
tzunghanjuang ee02d7e
Restore ReserseOp's signature if it is optimized away by one-shot-buf…
tzunghanjuang df63f1a
Use replaceOpWithNewBufferizedOp for quantum.unitary
tzunghanjuang 8a1c49a
Use old dealloaction steps
tzunghanjuang 160a0ed
Cleanup
tzunghanjuang 3f6eaf2
Fix var names in mlir debug test
tzunghanjuang f42b861
Test removing stride from memreftype in customCall
tzunghanjuang 3c4f0ca
Use SubView for allocCopyMemrefDyn if CastOP is not supported
tzunghanjuang 0eb6cbf
Use subview to handle memref with strides and offset
tzunghanjuang d7a0019
Use identity map and cleanup
tzunghanjuang 0a915b5
Add CallOp bufferization patch
tzunghanjuang 52fd238
Revert changes in frontend/test/pytest/test_debug.py
tzunghanjuang 18b2762
Add inline back to bufferization
tzunghanjuang 266ba24
Add functionOPInterface patch for mhlo
tzunghanjuang b915cff
Merge branch 'main' into bufferization-update
9d5fc4d
Correct bufferizeToMemoryWrite for setState and setBasisState
tzunghanjuang 0e10abb
Update linux-x86_64 wheel
tzunghanjuang a1dd5d5
Update macos-arm64 wheel
tzunghanjuang 4718c14
Update macos-x86-64 wheel
tzunghanjuang 64aa9ff
Update linux_arm64 scripts
tzunghanjuang cf56867
add lcurses flag to compile_executable
tzunghanjuang 6862700
Add copy-before-write only for async tests
tzunghanjuang de0b559
Merge branch 'main' into bufferization-update
ee47a0c
Clear subview work around in cg_global_bufferize
tzunghanjuang b858cde
Reformatting
tzunghanjuang e8eb51c
Try fixing wheel
tzunghanjuang da68883
Debug wheel
tzunghanjuang f0364ef
Try getting rid of exports
tzunghanjuang 0155585
Debug llvm path
tzunghanjuang 08b4493
Try different paths
tzunghanjuang a6281e0
Update patch paths in wheel scripts
tzunghanjuang df1c23f
Apply patch when getting LLVM and MHLO sources
tzunghanjuang b5b3876
Revert "Apply patch when getting LLVM and MHLO sources"
tzunghanjuang 0e0406b
Patch LLVM again before building wheel
tzunghanjuang 98fb3db
Apply patches right before building MLIR Dialects
tzunghanjuang 9401b97
Construct BUFFERIZATION_ASYNC_PASS in a concise way
tzunghanjuang c4b7b5e
Patch LLVM when building dialects in all the other wheel scripts
tzunghanjuang c36e160
Create cache with patches' hash
tzunghanjuang 2e6324a
Update patch and its name
tzunghanjuang 975b280
Reapply patch when building MLIR dialects
tzunghanjuang ddc0b41
Merge branch 'main' into bufferization-update
3e68cd8
Update changelog
tzunghanjuang 661a1d5
Add patch hash to macos-arm64
tzunghanjuang 9d5d117
Add patch hash to linux-arm64 wheel
tzunghanjuang 170d211
Make x86_64 use patch hash
tzunghanjuang 386f274
Install ncurses for linux-arm64 wheels
tzunghanjuang 17c94d6
Add top-level comments for bufferization
d58a215
Add comment that explains RestoreReverseOp
b438e4d
Update mlir/lib/Catalyst/Transforms/BufferizableOpInterfaceImpl.cpp
cf4018c
Update mlir/include/Gradient/Transforms/BufferizableOpInterfaceImpl.h
71abe78
Update mlir/include/Catalyst/Transforms/BufferizableOpInterfaceImpl.h
c138452
Use compare instead of ==
e8322ac
Add TODO reminder for removing patches after updating jax
761aaf7
Update mlir/Makefile
26c56d5
Add another TODO comment
d7cb22a
Merge branch 'main' into bufferization-update
0296eb9
Cleanup
c27fd57
Set bufferizesToMemoryWrite for CustomCallOp as true
b2879cf
Make CustomCallOp not return failure if its operands are not bufferizble
b69dd2a
Make CustomCallOp not return failure if its results are not bufferizble
9069ca8
Remove unused CustomCallOp members
9c93c2a
Implement bufferizesToAllocation for CallbackCallOp and CustomCallOp
323b093
Tentatively revert CustomCallOp bufferizesToMemoryWrite to false
009929b
Test disable lcurses
e327479
Remove lcurses installation
aa9f69c
Cleanup
87be1d3
Add comment to CallbackOp's bufferizesToMemoryWrite
143ba55
Add table of bufferizable ops
8d0324d
Small fix
6dc98b9
Small correction
44d4597
Set supportsUnstructuredControlFlow for CallBackOp as False
3cecfaf
Remove uncontrolflow from CallBackOp
2cb30e3
Bufferization comments (#1197)
erick-xanadu 812bf7f
Entirely remove all unstructure control flow
c76698a
Reformatting
5b488b2
Revert "Entirely remove all unstructure control flow"
3646328
set supportsUnstructuredControlFlow for forwardOp and reverseOp to false
938df91
Update mlir/lib/Quantum/Transforms/BufferizableOpInterfaceImpl.cpp
6c77916
Update mlir/lib/Quantum/Transforms/BufferizableOpInterfaceImpl.cpp
dfbe2a9
Merge branch 'main' into bufferization-update
erick-xanadu d1c0bde
wip
erick-xanadu 12bf618
Comments
erick-xanadu 3c0bb0a
f
erick-xanadu 619bf3d
More comments
erick-xanadu b49881e
Fix comments
erick-xanadu 9bda879
Remove unnecessary code
erick-xanadu 227c08e
style
erick-xanadu b179e70
Fix
erick-xanadu e4235d7
line length
erick-xanadu e0f6846
Merge branch 'main' into bufferization-update
erick-xanadu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.