slang icon indicating copy to clipboard operation
slang copied to clipboard

Make OptionKind::EmitSpirvDirectly turn ON by default for target CodeGenTarget target SPIRV

Open pmistryNV opened this issue 1 year ago • 5 comments
trafficstars

Blocked by:

  • #3547
  • Fix the perf issue exposed by #3547.
  • #3440
  • #3438
  • #3437

pmistryNV avatar Jan 22 '24 23:01 pmistryNV

@csyonghe kindly add the dependent bugs for this change to be made.

pmistryNV avatar Jan 22 '24 23:01 pmistryNV

+1, emitting SPIRV directly seems to be the more robust path from my experience. I think it makes sense that this becomes the default.

natevm avatar Jan 23 '24 19:01 natevm

Made direct edits in the original post to track dependent issues.

csyonghe avatar Jan 24 '24 01:01 csyonghe

Now that we understand what is causing NV driver to take so long to consume our SPIRV, we can implement a fix to avoid generating that pattern.

csyonghe avatar Feb 03 '24 17:02 csyonghe

Somewhat related, but if we switched direct-to-spirv on by default, then I could submit reproducers of bugs more easily through shader playground. Currently, shader playground uses the default glslang backend path.

natevm avatar Feb 08 '24 23:02 natevm

Q2-- let's not rush this transition.

swoods-nv avatar Mar 14 '24 19:03 swoods-nv

This should be a high priority. The current direct-to-SPIRV backend is (from my experience) much more stable than with the option off.

Even the more basic features like multiple entrypoints do not work without this flag.

Why should we not just make this the default today? Are there any blocking issues preventing us from just flipping the switch?

natevm avatar Mar 14 '24 23:03 natevm

We have users relying on some internal intrinsics that are only available on the glsl path. Switching now could break their code. We will implement the switch in early Q2.

csyonghe avatar Mar 15 '24 00:03 csyonghe

We should probably add a “—emit-spirv-indirectly” flag then.

For internal Nvidia users working on confidential Vulkan features, they should be the ones with the burden to add a flag to their build system, not the other way around.

Slang is cross vendor language, and if we want developers to believe that, we probably shouldn’t hold back features because of confidential Nvidia reasons.

In any case, there will always be internal intrinsics in glslang/glslc/dxc that aren’t yet implemented in Slang, so we need a very clear line here on what’s “good enough” to flip the switch.

Maybe that just means setting Q2 as the cutoff and giving some time for folks both internally and externally to switch over.

natevm avatar Mar 15 '24 02:03 natevm

I agree that most of our users will find the spirv backend to be far superior. However to flip the switch, we need to do some work around our CI and regression tests to ensure we don’t lose coverage for the glsl path. This will take some time so we probably won’t make the March deadline. We put this to Q2 so we don’t rush too hard for it, but it will be the first thing we do in April.


From: Nathan V. Morrical @.> Sent: Thursday, March 14, 2024 8:00:13 PM To: shader-slang/slang @.> Cc: Yong He @.>; Assign @.> Subject: Re: [shader-slang/slang] Make OptionKind::EmitSpirvDirectly turn ON by default for target CodeGenTarget target SPIRV (Issue #3477)

We should add a “—emit-spirv-indirectly” flag then. I don’t see why this should be a blocking issue.

For internal Nvidia users working on confidential Vulkan features, they should be the ones with the burden to add a flag to their build system, not the other way around.

Slang is cross vendor language, and if we want developers to believe that, we probably shouldn’t hold back features because .

In any case, there will always be internal intrinsics in glslang/glslc/dxc that aren’t yet implemented in Slang, so we need a very clear line here on what’s “good enough” to flip the switch.

— Reply to this email directly, view it on GitHubhttps://github.com/shader-slang/slang/issues/3477#issuecomment-1998854292, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAUHRBOCCINXPITCJ2KVMV3YYJP33AVCNFSM6AAAAABCGA3FM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJYHA2TIMRZGI. You are receiving this because you were assigned.Message ID: @.***>

csyonghe avatar Mar 15 '24 03:03 csyonghe

(Just to emphasize here-- Q2 is only two weeks away, so this isn't being pushed to the far future.)

swoods-nv avatar Mar 15 '24 15:03 swoods-nv

Ah, right. Time seems to have escaped me a bit. Yes, that’s not far out at all. Sometime mid April seems reasonable.

natevm avatar Mar 15 '24 16:03 natevm