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

Implement Timestamp Queries on Metal #2739

Closed
cwfitzgerald opened this issue Jun 6, 2022 · 2 comments · Fixed by #4008
Closed

Implement Timestamp Queries on Metal #2739

cwfitzgerald opened this issue Jun 6, 2022 · 2 comments · Fixed by #4008
Labels
api: metal Issues with Metal area: performance How fast things go help required We need community help to make this happen. type: enhancement New feature or request

Comments

@cwfitzgerald
Copy link
Member

cwfitzgerald commented Jun 6, 2022

Is your feature request related to a problem? Please describe.
Follow up to #2738, metal sspecial consideration for timestamps because of TBDR architectures.

Describe the solution you'd like
Align with upstream spec and implement on metal.

Hard part will be the stupid linear regression we need for timestamp period analysis.

Describe alternatives you've considered

None

Additional context
gpuweb/gpuweb#2190

@cwfitzgerald cwfitzgerald added type: enhancement New feature or request area: performance How fast things go api: metal Issues with Metal help required We need community help to make this happen. labels Jun 6, 2022
@Wumpf
Copy link
Member

Wumpf commented Oct 8, 2022

I understand the limitations of timestamps in TBDR architectures (i.e. the question for timestamp in a pass rather ill-posed). But could you please paraphrase the Hard part will be the stupid linear regression we need for timestamp period analysis. bit? Is this about the timestamp unit being under-specified as mentioned here gpuweb/gpuweb#1325 (comment)? How does this work currently on Intel/Nvidia Gpus where WRITE_TIMESTAMP_INSIDE_PASSES is allowed on Metal?

The originally indirectly linked webgpu issue is quite long 😅

@cwfitzgerald
Copy link
Member Author

Yeah the problem is how to get the timestamp unit. Through metal there is a single way of figuring out the unit. You need to call https://developer.apple.com/documentation/metal/mtldevice/3194378-sampletimestamps to get the cpu and gpu timestamps, but you need to call it twice and then determine the "slope" between the two calls to figure out the gpu timestamp unit. On Apple chips the timestamps are always the same, but on intel/nvidia/amd the timestamps will both be different and have a different unit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: metal Issues with Metal area: performance How fast things go help required We need community help to make this happen. type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants