Skip to content

FP16 Extension against spec#2696

Merged
kdashg merged 15 commits intogpuweb:mainfrom
jiangzhaoming:FP16Spec
Apr 12, 2022
Merged

FP16 Extension against spec#2696
kdashg merged 15 commits intogpuweb:mainfrom
jiangzhaoming:FP16Spec

Conversation

@jiangzhaoming
Copy link
Copy Markdown
Contributor

@jiangzhaoming jiangzhaoming commented Mar 25, 2022

FP16 extension against the whole spec, merging the proposed changes into WebGPU and WGSL spec.
The related issue is #2512.
The FP16 extension document (PR #2647) is intend to be aligned with this PR.


Preview | Diff

@jiangzhaoming jiangzhaoming marked this pull request as draft March 25, 2022 14:51
@github-actions
Copy link
Copy Markdown
Contributor

Previews, as seen when this build job started (0595a49):
WebGPU | IDL
WGSL
Explainer

@github-actions
Copy link
Copy Markdown
Contributor

Previews, as seen when this build job started (f19625c):
WebGPU | IDL
WGSL
Explainer

@github-actions
Copy link
Copy Markdown
Contributor

Previews, as seen when this build job started (8a519dc):
WebGPU | IDL
WGSL
Explainer

@jiangzhaoming jiangzhaoming changed the title [WIP] FP16 Extension against spec FP16 Extension against spec Mar 28, 2022
@jiangzhaoming jiangzhaoming marked this pull request as ready for review March 28, 2022 06:18
@jiangzhaoming
Copy link
Copy Markdown
Contributor Author

Please take a look, thanks

@Kangz
Copy link
Copy Markdown
Contributor

Kangz commented Mar 28, 2022

That's a lot of reviewers you added. Can you try to limit them a bit, maybe one for the API spec and one for the WGSL spec?

@alan-baker
Copy link
Copy Markdown
Contributor

In the 2022-03-29 meeting, the group arrived at a consensus of adding a literal suffix for f16. See #2664.

Separately, literal unification (#2227) was merged so you'll likely want to rebase and update your PR based on those changes.

Copy link
Copy Markdown
Contributor

@kainino0x kainino0x left a comment

Choose a reason for hiding this comment

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

(reviewed API spec only)

Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
@github-actions
Copy link
Copy Markdown
Contributor

Previews, as seen when this build job started (e6735a5):
WebGPU | IDL
WGSL
Explainer

Copy link
Copy Markdown
Contributor

@kainino0x kainino0x left a comment

Choose a reason for hiding this comment

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

API spec LGTM

Copy link
Copy Markdown
Contributor

@alan-baker alan-baker left a comment

Choose a reason for hiding this comment

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

WGSL looks good overall. Mostly minor comments.

Comment thread wgsl/index.bs Outdated
* the 32-bit signed integer value `1i`,
* the 32-bit unsigned integer value `1u`,
* the 32-bit floating point value `1.0f`,
* the 16-bit floating point value `1.0h` if `f16` extension is enabled,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If f16 is not enabled, what is the value of 1.0h? That is, is the h suffix valid with the extension enabled?

I would suggest it should be a shader-creation error if the h suffix is used without the extension enabled.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is now explicitly stated in the Literals section.

Comment thread wgsl/index.bs Outdated
Comment thread wgsl/index.bs Outdated
Comment thread wgsl/index.bs Outdated
Comment thread wgsl/index.bs Outdated
Comment thread wgsl/index.bs Outdated
Comment thread wgsl/index.bs Outdated
Comment thread wgsl/index.bs
Comment thread wgsl/index.bs Outdated
<table class='data'>
<thead>
<tr><td>Overload<td>Description
<tr><td>Parameterization<td>Overload<td>Description
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not a huge fan of the asymmetry here between pack and unpack built-in functions. I'd suggest either removing the f16 versions of packing or rename all the functions similarly to MSL, e.g.:

pack4x8snormf16
pack4x8snormf32
unpack4x8snormf16
unpack4x8snormf32

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Remove the f16 version of packing.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2022

Previews, as seen when this build job started (9a84ffd):
WebGPU | IDL
WGSL
Explainer

Copy link
Copy Markdown
Contributor

@alan-baker alan-baker left a comment

Choose a reason for hiding this comment

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

Thanks for the changes!

Copy link
Copy Markdown
Contributor

@dneto0 dneto0 left a comment

Choose a reason for hiding this comment

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

This looks great!

I pointed out a couple of grammar details that we can fix before or after landing.

Comment thread spec/index.bs Outdated
Comment thread wgsl/index.bs Outdated
Comment thread wgsl/index.bs
|T| is i32, u32, or f32
<td class="nowrap">bitcast&lt;vec4&lt;f16&gt;&gt;(|e|): vec4&lt;f16&gt;
<td>Reinterpretation of bits as vec4&lt;f16&gt;.<br>
The result is the reinterpretation of the 64 bits in |e| as a vec4&lt;f16&gt; value, following the internal layout rules.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a really nice way to say it: "following the internal layout rules".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To be clear, I'm not asking for a change. But I think after landing there may be a way to simplify this section by referencing the layout rules for the whole section.

@github-actions
Copy link
Copy Markdown
Contributor

Previews, as seen when this build job started (8da687b):
WebGPU | IDL
WGSL
Explainer

@kdashg
Copy link
Copy Markdown
Contributor

kdashg commented Apr 12, 2022

WGSL meeting minutes 2022-04-05
  • Update:
  • ZJ: I have slides
  • ZJ: Do we have any comments on the ranking changes?
  • DN: We don’t have consensus on that approach yet, so let’s try not to block fp16 on that.
  • MM: I can give more background. During office hour, there were concerns about the h suffix, and I remembered back to a previous call where we briefly discussed an extension idea to change the default float type. It sounds like that extension is likely to change our decision on h-suffix, but until someone proposes that extension, we should let the h-suffix extension stand.
  • AB: I expect it is in good shape. Have to review this version.
  • ZJ: We’re somewhat concerned that there aren’t many comments on the other parts of the PR
  • AB: Sorry, planning to do a more detailed review, but from what I remember we’re mostly satisfied with the overall shape of this.
  • AB: Given that we only have these live meetings once a month, are you ok with offline comments, or did you want another round of online comments?
  • ZJ: Either is good.

@jiangzhaoming
Copy link
Copy Markdown
Contributor Author

@tidoust
Hi, this PR has been approved by reviewers, but the check "ipr" is still "Waiting for status to be reported" (have been in this status from the PR was submitted). When looking at the W3C repository Manager, clicking "Revalidate" will result in an error message "PR not found: gpuweb/gpuweb/pulls/2696", which is kind of confusing.
Could you please take a look? Thanks!

@tidoust
Copy link
Copy Markdown
Contributor

tidoust commented Apr 12, 2022

@tidoust
Hi, this PR has been approved by reviewers, but the check "ipr" is still "Waiting for status to be reported" (have been in this status from the PR was submitted). When looking at the W3C repository Manager, clicking "Revalidate" will result in an error message "PR not found: gpuweb/gpuweb/pulls/2696", which is kind of confusing.
Could you please take a look? Thanks!

Sorry about that. When this happens, it means that the IPR bot crashed when it ran. That does not happen often but it does happen once in a while. Unfortunately, as far as I know, there is no easy way to re-run the bot on the PR when that happens, except by re-creating the PR.

I confirm that the IPR bot would have reported a green flag here, and suggest that spec editors merge the PR as-is (they should have the power to do so from a GitHub permissions perspective).

@jiangzhaoming
Copy link
Copy Markdown
Contributor Author

@tidoust
Hi, this PR has been approved by reviewers, but the check "ipr" is still "Waiting for status to be reported" (have been in this status from the PR was submitted). When looking at the W3C repository Manager, clicking "Revalidate" will result in an error message "PR not found: gpuweb/gpuweb/pulls/2696", which is kind of confusing.
Could you please take a look? Thanks!

Sorry about that. When this happens, it means that the IPR bot crashed when it ran. That does not happen often but it does happen once in a while. Unfortunately, as far as I know, there is no easy way to re-run the bot on the PR when that happens, except by re-creating the PR.

I confirm that the IPR bot would have reported a green flag here, and suggest that spec editors merge the PR as-is (they should have the power to do so from a GitHub permissions perspective).

Thanks!

@kdashg kdashg merged commit 3e48cab into gpuweb:main Apr 12, 2022
github-actions bot added a commit that referenced this pull request Apr 12, 2022
SHA: 3e48cab
Reason: push, by @kdashg

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Apr 12, 2022
SHA: 3e48cab
Reason: push, by @kdashg

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Apr 12, 2022
SHA: 3e48cab
Reason: push, by @kdashg

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@kdashg
Copy link
Copy Markdown
Contributor

kdashg commented Apr 13, 2022

WGSL meeting minutes 2022-04-12
  • Offline:
    • David and Alan reviewed and approve
  • Alan: API signed off already. Good to land.
  • Merge

@jiangzhaoming
Copy link
Copy Markdown
Contributor Author

Shall this PR close issue #658?

@jiangzhaoming jiangzhaoming mentioned this pull request Apr 21, 2022
toji pushed a commit that referenced this pull request Apr 28, 2022
* FP16 Extension spec: WIP

* Add ID for extension list section.

* Fix typo

* Fix typo

* Changes for WebGPU spec

* Fix typo

* Fix typo

* Fix typo

* Update accroding to comments

* F16 literals require f16 extension

* Remove packing function for f16

* Fix grammar
jdarpinian pushed a commit to jdarpinian/gpuweb that referenced this pull request Aug 12, 2022
* FP16 Extension spec: WIP

* Add ID for extension list section.

* Fix typo

* Fix typo

* Changes for WebGPU spec

* Fix typo

* Fix typo

* Fix typo

* Update accroding to comments

* F16 literals require f16 extension

* Remove packing function for f16

* Fix grammar
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.

8 participants