summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-02-21Added support for simple while loops (#2667)Sai Praveen Bangaru
* Added support for simple while loops * Fix support for while loops by changing logic to grab the loop update block
2023-02-21Take into account the optimization level requested in TargetDesc (#2649)Ellie Hermaszewska
* Take into account the optimization level requested in TargetDesc Combines conflicting optimization levels by taking the maximum between them; as such they now each represent the lower bound on the eventual optimization level. Most of the changes are making this clear by s/optimizationLevel/minimumOptimizationLevel Closes https://github.com/shader-slang/slang/issues/2324 * Remove optimization level from TargetDesc
2023-02-20Miscellaneous backward autodiff fixes. (#2665)Yong He
* Fix differentiable type registration * Fix use of non-differentiable return value in a differentiable func. * Fix use of primal inst that does not dominate the diff block. * Fix primal inst hoisting, and add missing type legalization logic. * Make `detach` defined on all differentiable T. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-20Add static for loop iteration inference. (#2659)Yong He
2023-02-17Allocate N+1 arrays instead of N to avoid out-of-bounds access when ↵Sai Praveen Bangaru
unzipping loops (#2663)
2023-02-17AD: More legacy type handling cleanup + user-defined reverse-mode fix (#2662)Sai Praveen Bangaru
* WIP: Remove all legacy type checking * Fixed issue with user-defined backward derivatives not bypassing the AD process --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-02-17AD: Remove the original loop condition upon inversion (#2661)Sai Praveen Bangaru
* Remove the original condition upon loop inversion (it's redundant, and causes out-of-bounds accesses) * minor fix (also removed the first loop check skip) * Cleanup unused insts * minor comment fix
2023-02-17Fixed crash when lowering IR for no_diff struct member. (#2658)Yong He
* Fixed crash when lowering IR for no_diff struct member. * Improve `setInsertBeforeOrdinaryInst` and `setInsertAfterOrdinaryInst`. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-17Cleaned up legacy differential type handling + type casting bugfixes (#2660)Sai Praveen Bangaru
2023-02-17Proper reverse-mode loop handling with splitting + inversion steps (#2656)Sai Praveen Bangaru
* Halfway to loop inversion * More progress towards proper loop inversion * More progress towards inverse insts. Only thing left is adding `counter>=0` at the right place * More fixes for inversion step. * Lots more fixes, added primal inst 'hoisting' mechanism as the central method that ensures primal values are placed in the right spot * Loop inversion is now functional * Cleaned up commented code * rename diffCounterVar -> diffCounterParam * minor update * removed some comments and commented code * Switch `IRBuilder(sharedIRBuilder)` to `IRBuilder(moduleInst)`
2023-02-16Remove `SharedIRBuilder`. (#2657)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-16Overhaul global inst deduplication and cpp/cuda backend. (#2654)Yong He
* Overhaul global inst deduplication and cpp/cuda backend. * Update IR documentation. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-16Design doc on IR deduplication and best practices when working with IRYong He
2023-02-15Treat user defined backward derivative function as non differentiable. (#2650)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-15Upgrade to GLSLANG 12.0.0 binaries (#2652)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Upgrade GLSLANG binaries to 12.0.0
2023-02-15Upgrade GLSLANG 12.0.0 (#2651)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Update to glslang 12.0.0. Update SPIRV-Tools SPIRV-Headers.
2023-02-14Preliminary Shader Execution Reordering Doc (#2648)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Add preliminary Shader Execution Reordering doc. Update target-compatibility docs. * Fix debugBreak.
2023-02-14Preliminary debugBreak support (#2647)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Preliminary support for debug break. * Add C++ debug break support. Add details about usage. * Improve debug break test details. * Make HLSL output a comment about no support. * Handle specialize for target assert, without a body if it has spv_instruction/target intrinsic
2023-02-13Various auto-diff bug fixes. (#2646)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-13Eliminate `continue` to allow unrolling any loops. (#2645)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-13Add Loop Unrolling Pass. (#2644)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-11Update README.md on auto diff feature.Yong He
2023-02-11Update 07-autodiff.mdYong He
2023-02-11Update 07-autodiff.mdYong He
2023-02-11Update 07-autodiff.mdYong He
2023-02-11Take into account existing initializer list type when performing coercions ↵Ellie Hermaszewska
(#2641) Fixes https://github.com/shader-slang/slang/issues/2189
2023-02-11Comment call to vkCreateInstance with a potential pitfall (#2642)Ellie Hermaszewska
Although we could in principle write this explanatory message to stderr, that would entangle this call with the layer search above for what is probably a very unlikely possibility on any normal system.
2023-02-10Fix several autodiff bugs. (#2643)Yong He
2023-02-10Fix checking of `[BackwardDerivativeOf]` attribute. (#2640)Yong He
* Fix checking of `[BackwardDerivativeOf]` attribute. * Fix crash in `canInstHaveSideEffectAtAddress`. * Fix. * Revert fix. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-09Reverse-mode Loop Support (#2635)Sai Praveen Bangaru
* Full loop support now working. MaxItersAttr in progress * Lookup table updates? * Fixed the max iters decoration * Minox fixes & remove superfluous code * fixup warnings * Revert "Lookup table updates?" This reverts commit 7d9b0793fb5239f31d1155776e846dcf1892d8d9. * Update 07-autodiff.md * Change maxiters to MaxIters * Added asserts * Update 07-autodiff.md
2023-02-09Fixed derivatives for kIROp_Neg and kIROp_Div, added another test (#2639)Sai Praveen Bangaru
2023-02-09Use stable sort in generation of lookup tables (#2638)Ellie Hermaszewska
* Add Slang::List::stableSort * Use stable sort in generation of lookup tables * Disable newline translation when writing lookup tables
2023-02-08Update 07-autodiff.mdYong He
2023-02-08Replace \cal with \mathbb (#2637)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-08Update autodiff documentation with more precise math definitions. (#2636)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-07Add backward derivatives for functions in diff.meta.slang (#2633)winmad
* WIP: start adding backward derivatives * Overhaul `transposeParameterBlock` to support `inout` params. * Small bug fixes. * Bug fix on differentiable intrinsic specialization. * Fixes. * Run autodiff tests on CPU. * Clean up. * Overhaul `transposeParameterBlock` to support `inout` params. * Small bug fixes. * Bug fix on differentiable intrinsic specialization. * Fixes. * Run autodiff tests on CPU. * Clean up. * More bug fixes., * WIP: working on detach * Arithmetic simplifications and more IR clean up logic. * WIP: adding detach and abs * Fix detach and abs * Fix. * Add IR transform pass for cleaner code emit. * Fix test cases. * Fix type system logic for reference type. * Add backward derivatives for functions that already have forward derivatives * Fix changes --------- Co-authored-by: Yong He <yhe@nvidia.com> Co-authored-by: Lifan Wu <lifanw@nvidia.com>
2023-02-07Arithmetic simplifications and more IR clean up logic. (#2632)Yong He
2023-02-06Update documentation (#2631)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-06Fix documentation (#2630)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-06Update documentation TOC (#2629)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-06Improve autodiff documentation (#2628)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-06Fixup documentation (#2627)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-06Add documentation for autodiff feature (#2626)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-06GFX: make dispatch commands return error code. (#2625)Yong He
* GFX: make dispatch commands return error code. * Fix cuda. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-06Fix crash when processing nested switch. (#2624)Yong He
* Fix crash when processing nested switch. * Clean up. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-04Patch transcription of `inout` non differentiable params. (#2623)Yong He
2023-02-03Overhaul `transposeParameterBlock` to support `inout` params. (#2621)Yong He
* Overhaul `transposeParameterBlock` to support `inout` params. * Small bug fixes. * Bug fix on differentiable intrinsic specialization. * Fixes. * Run autodiff tests on CPU. * Clean up. * More bug fixes., * Add test coverage on inout param. * Fix language server hinting for transcribed mutable params. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-03Small fixes around repro (#2622)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Fix issues in repo due to C++ expression evaluation ordering is undefined.
2023-02-03Correct indentation in premake lua (#2620)Ellie Hermaszewska
No semantic change
2023-02-03Use SPIR-V opcode names rather than numbers (#2571)Ellie Hermaszewska
* s/emititng blobal/emitting global * Use SPIR-V opcode names rather than numbers * regenerate Visual Studio project files * Use names for extended SPIR-V GLSL instructions * Add missing operand for SPIR-V extended instruction * Add warning aginst modifying generated hashing files * Squash warnings on MSVC