Skip to content

Adding #util.composite attribute. - #6854

Merged
benvanik merged 1 commit into
mainfrom
benvanik-composite
Aug 25, 2021
Merged

benvanik merged 1 commit into
mainfrom
benvanik-composite

Conversation

@benvanik

@benvanik benvanik commented Aug 25, 2021 •

Copy link
Copy Markdown
Collaborator

This allows us to compose multiple serializable attributes without
creating a new uniqued attribute, saving tons of memory during constant
packing and other operations that stitch together constants.

This also uses these newfangled attribute interface things to allow
streaming serialization of data-carrying attributes. Though there's
still some glue required for the flatbuffers case we are almost zero-copy
for the whole route from the start of the HAL dialect to the final output.

Fixes #3354.

@benvanik benvanik added compiler/dialects Relating to the IREE compiler dialects (flow, hal, vm) performance ⚡ Performance/optimization related work across the compiler and runtime labels Aug 25, 2021
@google-cla google-cla Bot added the cla: yes label Aug 25, 2021
@benvanik
benvanik force-pushed the benvanik-composite branch 2 times, most recently from 21373be to 7cac8c7 Compare August 25, 2021 15:33
@benvanik
benvanik marked this pull request as ready for review August 25, 2021 15:33
@benvanik
benvanik requested a review from ScottTodd August 25, 2021 15:33
@benvanik
benvanik force-pushed the benvanik-composite branch from 7cac8c7 to 70c2123 Compare August 25, 2021 16:01
@@ -1,20 +1,24 @@
// RUN: iree-opt -split-input-file -iree-hal-pack-constant-pool-storage %s | IreeFileCheck %s
// RUN: iree-opt -split-input-file -iree-hal-pack-constant-pool-storage -mlir-print-local-scope %s | IreeFileCheck %s

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Intentional -mlir-print-local-scope? What's that changing here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yeah that prevents attribute aliases so they stay inlined, which makes CHECKing them much easier (can check where they are conceptually located in the IR vs at the top of the module).

This allows us to compose multiple serializable attributes without
creating a new uniqued attribute, saving tons of memory during constant
packing and other operations that stitch together constants.

This also uses these newfangled attribute interface things to allow
streaming serialization of data-carrying attributes. Though there's
still some glue required for the flatbuffers case we are almost zero-copy
for the whole route from the start of the HAL dialect to the final output.

Fixes #3354.
@benvanik
benvanik force-pushed the benvanik-composite branch from 70c2123 to e59758e Compare August 25, 2021 17:38
@benvanik
benvanik enabled auto-merge (squash) August 25, 2021 18:17
@benvanik
benvanik merged commit 30463f1 into main Aug 25, 2021
@benvanik
benvanik deleted the benvanik-composite branch August 25, 2021 18:35
@hanhanW hanhanW mentioned this pull request Aug 25, 2021
copybara-service Bot pushed a commit that referenced this pull request Aug 25, 2021
* 30463f1 Adding #util.composite attribute. (#6854)
* 7a1c579 Implement function.py return type coercion (#6832)
* d90f0fc Remove PromoteTensorLoads pass, convert ExtractOp in TensorToFlow. (#6852)
* 7fa8c20 Update SwiftShader to 2021-08-25 (#6859)
* a328761 Rename Bazel repo iree_vulkan_headers to vulkan_headers (#6862)
* 7660e49 Merge pull request #6856 from google/benvanik-shared-target-backend
* ebc5eb5 Removing the pipeline caching during executable translation. (#6855)
* 2fb7a8d Reapply "Update TFLite concrete function conversion codes" (#6800)
* ce7b475 NFC: Merge ConvertToFlow passes into dedicated before/after passes. (#6850)
* 9fce2d6 Support f32 in the VM by default in the compiler. (#6744)
* b6baea9 Support global ref ops and fix passing of refs on function boundaries in the C..
* 4b5d2ed Bump flatcc version (#6853)
* c8a8f5d Add e2e tests for mhlo.bitcast_convert (#6846)

COPYBARA_INTEGRATE_REVIEW=#6865 from hanhanW:main-to-google 30463f1
PiperOrigin-RevId: 392952973
iree-github-actions-bot pushed a commit that referenced this pull request Aug 25, 2021
* 30463f1 Adding #util.composite attribute. (#6854)
* 7a1c579 Implement function.py return type coercion (#6832)
* d90f0fc Remove PromoteTensorLoads pass, convert ExtractOp in TensorToFlow. (#6852)
* 7fa8c20 Update SwiftShader to 2021-08-25 (#6859)
* a328761 Rename Bazel repo iree_vulkan_headers to vulkan_headers (#6862)
* 7660e49 Merge pull request #6856 from google/benvanik-shared-target-backend
* ebc5eb5 Removing the pipeline caching during executable translation. (#6855)
* 2fb7a8d Reapply "Update TFLite concrete function conversion codes" (#6800)
* ce7b475 NFC: Merge ConvertToFlow passes into dedicated before/after passes. (#6850)
* 9fce2d6 Support f32 in the VM by default in the compiler. (#6744)
* b6baea9 Support global ref ops and fix passing of refs on function boundaries in the C..
* 4b5d2ed Bump flatcc version (#6853)
* c8a8f5d Add e2e tests for mhlo.bitcast_convert (#6846)

PiperOrigin-RevId: 392952973
benvanik added a commit that referenced this pull request Jul 11, 2023
This was replaced in PR #6854 with SerializableAttrInterface.
benvanik added a commit that referenced this pull request Jul 11, 2023
This was replaced in PR #6854 with SerializableAttrInterface.
nhasabni pushed a commit to plaidml/iree that referenced this pull request Aug 24, 2023
This was replaced in PR iree-org#6854 with SerializableAttrInterface.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler/dialects Relating to the IREE compiler dialects (flow, hal, vm) performance ⚡ Performance/optimization related work across the compiler and runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iree.composite_buffer type to reduce malloc storm during lowering

2 participants