Skip to content

Comments

Rework the sync async algorithms based on PR 323#329

Merged
anssiko merged 3 commits intowebmachinelearning:mainfrom
zolkis:improve-sync-async-execution
Aug 10, 2023
Merged

Rework the sync async algorithms based on PR 323#329
anssiko merged 3 commits intowebmachinelearning:mainfrom
zolkis:improve-sync-async-execution

Conversation

@zolkis
Copy link
Collaborator

@zolkis zolkis commented Jan 18, 2023

Factor out graph input/output validation.
Factor out graph execution algorithm.
Used them in the sync and async algorithm steps.


Preview | Diff

@zolkis
Copy link
Collaborator Author

zolkis commented Jan 18, 2023

Looks like there are some changes due to auto-save: in some PRs before me, there were some trailing spaces. Please set your editors to remove trailing spaces.

@zolkis
Copy link
Collaborator Author

zolkis commented Jan 19, 2023

@huningxin @wchao1115 @anssiko PTAL

@zolkis
Copy link
Collaborator Author

zolkis commented Jan 19, 2023

I tried the the diff and preview, but they won't help much in reviewing these changes.
I found it easier to place 2 windows side by side and compare the versions "manually":

  • check the resource validation algorithm vs the validation sections of the compute algorithms;
  • check the usages of the resource validation algorithm vs the original;
  • check the execute graph algorithm vs the sync compute() vs the original;
  • check the async compute() vs the original;
  • ignore the (automatic) white space changes (we can talk about them in the call).

@zolkis
Copy link
Collaborator Author

zolkis commented Jan 20, 2023

Still work in progress... I want to find a better way to express underlying graph execution / compute requests, it also overlaps with other algorithms (graph internal slots, operand internal slots etc.)

@zolkis zolkis changed the title Rework the sync async algorithms based on #323 WiP: Rework the sync async algorithms based on #323 Jan 20, 2023
@zolkis zolkis changed the title WiP: Rework the sync async algorithms based on #323 Rework the sync async algorithms based on #323 Feb 7, 2023
@zolkis
Copy link
Collaborator Author

zolkis commented Feb 8, 2023

@huningxin could you please check for correctness?

@dontcallmedom dontcallmedom linked an issue Mar 16, 2023 that may be closed by this pull request
@anssiko anssiko requested a review from wchao1115 March 16, 2023 16:02
Copy link
Contributor

@huningxin huningxin left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @zolkis !

zolkis pushed a commit to zolkis/webnn that referenced this pull request Mar 24, 2023
zolkis pushed a commit to zolkis/webnn that referenced this pull request May 14, 2023
Squashed the following commits:
Enclose arg + return descriptions to separate from normative algorithms
Change manual link to autolink
Use the 'get a copy' reference for buffer source
Factor our validating bufferview with descriptor
Fix initialization typo
Add reference to the platform operand object  MLOperand/[[operand]]
Lift dependency changes from webmachinelearning#337
Fix typos, remove unneeded dependencies from webmachinelearning#337
Add dependency for buffer validation from webmachinelearning#329
Fix the scalar algorithm / comments
Discern between scalar and tensor constant, fix typos
Fix review comments. Add stylistic boxes for algorithm steps, informal steps, internal slots
Fix typo. Remove stylistic boxes for now.
Address reviews comments. Remove MLOperandKind typedef from the IDL.
Move note to text. Make the check on kind an assert.
Remove the MLOperand/[[kind]] internal slot and creation parameter.
Remove back quotes from title

Signed-off-by: Zoltan Kis <[email protected]>
zolkis pushed a commit to zolkis/webnn that referenced this pull request May 14, 2023
Squashed the following commits:
    Enclose arg + return descriptions to separate from normative algorithms
    Change manual link to autolink
    Use the 'get a copy' reference for buffer source
    Factor our validating bufferview with descriptor
    Fix initialization typo
    Add reference to the platform operand object  MLOperand/[[operand]]
    Lift dependency changes from webmachinelearning#337
    Fix typos, remove unneeded dependencies from webmachinelearning#337
    Add dependency for buffer validation from webmachinelearning#329
    Fix the scalar algorithm / comments
    Discern between scalar and tensor constant, fix typos
    Fix review comments. Add stylistic boxes for algorithm steps, informal steps, internal slots
    Fix typo. Remove stylistic boxes for now.
    Address reviews comments. Remove MLOperandKind typedef from the IDL.
    Move note to text. Make the check on kind an assert.
    Remove the MLOperand/[[kind]] internal slot and creation parameter.
    Remove back quotes from title

Signed-off-by: Zoltan Kis <[email protected]>
zolkis pushed a commit to zolkis/webnn that referenced this pull request May 15, 2023
Squashed the following commits:
    Enclose arg + return descriptions to separate from normative algorithms
    Change manual link to autolink
    Use the 'get a copy' reference for buffer source
    Factor our validating bufferview with descriptor
    Fix initialization typo
    Add reference to the platform operand object  MLOperand/[[operand]]
    Lift dependency changes from webmachinelearning#337
    Fix typos, remove unneeded dependencies from webmachinelearning#337
    Add dependency for buffer validation from webmachinelearning#329
    Fix the scalar algorithm / comments
    Discern between scalar and tensor constant, fix typos
    Fix review comments. Add stylistic boxes for algorithm steps, informal steps, internal slots
    Fix typo. Remove stylistic boxes for now.
    Address reviews comments. Remove MLOperandKind typedef from the IDL.
    Move note to text. Make the check on kind an assert.
    Remove the MLOperand/[[kind]] internal slot and creation parameter.
    Remove back quotes from title

Signed-off-by: Zoltan Kis <[email protected]>
anssiko pushed a commit that referenced this pull request May 15, 2023
Squashed the following commits:
    Enclose arg + return descriptions to separate from normative algorithms
    Change manual link to autolink
    Use the 'get a copy' reference for buffer source
    Factor our validating bufferview with descriptor
    Fix initialization typo
    Add reference to the platform operand object  MLOperand/[[operand]]
    Lift dependency changes from #337
    Fix typos, remove unneeded dependencies from #337
    Add dependency for buffer validation from #329
    Fix the scalar algorithm / comments
    Discern between scalar and tensor constant, fix typos
    Fix review comments. Add stylistic boxes for algorithm steps, informal steps, internal slots
    Fix typo. Remove stylistic boxes for now.
    Address reviews comments. Remove MLOperandKind typedef from the IDL.
    Move note to text. Make the check on kind an assert.
    Remove the MLOperand/[[kind]] internal slot and creation parameter.
    Remove back quotes from title

Signed-off-by: Zoltan Kis <[email protected]>
@zolkis zolkis changed the title Rework the sync async algorithms based on #323 Rework the sync async algorithms based on PR 323 May 16, 2023
…rning#323

Squashed from the following commits:
    Add link to asserts
    Clarify the graph execution steps
    Address review comments for graph execution
    Factor out buffer validation vs descriptor
    Remove note about execution

Signed-off-by: Zoltan Kis <[email protected]>
@zolkis zolkis force-pushed the improve-sync-async-execution branch from bf7341a to 95c9bd1 Compare May 16, 2023 15:40
@zolkis
Copy link
Collaborator Author

zolkis commented May 16, 2023

@wchao1115 PTAL: this is editorial, but reformulates wording and factors out sub-steps.
Cleaned up to one squashed commit.

@zolkis
Copy link
Collaborator Author

zolkis commented Jun 19, 2023

This would need to be merged, as needed in zk-conventions-integration, and only adds editorial changes to a previous PR.

@wchao1115
Copy link
Collaborator

@zolkis Should we discard this PR in favor of merging the work into the staging branch? This is one of the oldests in the queue.

@zolkis
Copy link
Collaborator Author

zolkis commented Jun 19, 2023

This is quite different from that staging set of changes. Mainly editorial, factoring out some parts. This still belongs to the main branch IMHO. Technically it is possible to move there, but its value is in the main branch.

@wchao1115
Copy link
Collaborator

@zolkis Can you help me understand why can't this change be staged in the staging branch like others? Given that it's been many months in the PR queue and still requires 1 more approval with several comments still outstanding, can we please move this out to the staging branch?

@zolkis
Copy link
Collaborator Author

zolkis commented Jun 20, 2023

@zolkis Can you help me understand why can't this change be staged in the staging branch like others? Given that it's been many months in the PR queue and still requires 1 more approval with several comments still outstanding, can we please move this out to the staging branch?

I didn't say it can't be staged. I said it does not belong there.
This change has been reviewed and approved on March 17 by one editor.
It has only been missing your review.
I don't see any comments that are outstanding. Could you point to those?

@anssiko
Copy link
Member

anssiko commented Jun 20, 2023

I marked the last remaining discussion as resolved.

@wchao1115 would merging this to main now complicate your expected future changes?

If it does, we can merge to the integration branch instead.

This enhancement PR is a by-product of discussion in PR #323. I understand this context may have been lost because there were multiple now closed WIP PRs before this one.

@zolkis
Copy link
Collaborator Author

zolkis commented Jun 20, 2023

Right, if merging this conflicts too much with your upcoming PRs @wchao1115 , we can move this to staging, but let's try to merge it here.

@anssiko
Copy link
Member

anssiko commented Jun 29, 2023

CI build fails with:

WARNING: Multiple elements have the same ID 'validate-buffer-with-descriptor'.
Deduping, but this ID may not be stable across revisions.
FATAL ERROR: Multiple local 'dfn' <dfn>s have the same linking text 'validate buffer with descriptor'.

@zolkis please check and fix.

@zolkis
Copy link
Collaborator Author

zolkis commented Aug 9, 2023

@wchao1115 could you please check if you'd be fine merging this? It concerns @huningxin 's changes, has 2 approvals and it's editorial, factoring out common parts and making the algorithms more compact. It doesn't strictly belong to the kind of changes in conventions integration, and it's been discussed several times in calls.

Is there something left undone? Or do you sustain this should be discarded and include the changes in the conventions integration?

@wchao1115
Copy link
Collaborator

@wchao1115 could you please check if you'd be fine merging this?

Yes, I approved.

@anssiko
Copy link
Member

anssiko commented Aug 10, 2023

Thanks @wchao1115 for your review. I'll squash and merge so that @zolkis can pull these changes into his integration branch.

@anssiko anssiko merged commit 8e63e07 into webmachinelearning:main Aug 10, 2023
github-actions bot added a commit that referenced this pull request Aug 10, 2023
SHA: 8e63e07
Reason: push, by anssiko

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@zolkis zolkis deleted the improve-sync-async-execution branch November 12, 2024 14:00
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.

Review sync vs async compute differences

5 participants