summaryrefslogtreecommitdiff
path: root/source/slang/diff.meta.slang
AgeCommit message (Collapse)Author
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-01-30Make ArrayExpressionType a DeclRefType and define its autodiff extension in ↵Yong He
stdlib. (#2615) * Allow array parameters in forward diff. * Use type canonicalization instead of coersion. * Reimplement array type. * Fix. * Update test case. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-01-17First custom backward-derivative test case working. (#2598)Yong He
2023-01-13Frontend work for `[BackwardDerivative]` and `[BackwardDerivativeOf]`. (#2589)Yong He
* Frontend work for `[BackwardDerivative]` and `[BackwardDerivativeOf]`. * Fix clang issue. * Fix. * fix gcc issue * fix formatting. Co-authored-by: Yong He <yhe@nvidia.com>
2022-12-09Add `diffPair` stdlib function. (#2560)Yong He
2022-12-08Auto-diff for matrix operations. (#2559)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2022-12-02Add helper functions to update DifferentialPair (#2547)winmad
2022-12-01Allow `no_diff` on `this` parameter. (#2543)Yong He
2022-11-14Adding some math functions and their derivatives (#2497)winmad
2022-11-14Minimum binary arithmetic reverse autodiff working. (#2514)Edward Liu
* Initial plumbing of backward autodiff in the frontend. * More plumbing. * Initial reverse autodiff working. * Bug fixes. * Misc. * Remove redundant code. * More clean up. * Misc. * Rebase and add backward diff test. * Disable test. * Clean up. * Minor fix. Co-authored-by: Yong He <yhe@nvidia.com>
2022-11-09Add `[ForwardDerivativeOf]` attribute. (#2501)Yong He
* Add [ForwardDerivativeOf] attribute. * Fix handling around phi nodes. * Fixes. * Remove IR opcode for ForwardDerivativeOfDecoration. Co-authored-by: Yong He <yhe@nvidia.com>
2022-11-08Make `__BuiltinFloatingPointType` conform to `IDifferentiable`. (#2499)Yong He
2022-11-04Use property for `DifferentialPair` accessors. (#2493)Yong He
2022-11-04Higher order differentiation. (#2487)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2022-11-01Added a vector intrinsic definition for exp (to serve as template for other ↵Sai Praveen Bangaru
vector intrinsics) (#2481) * Added vector exp definition * Naming
2022-11-01Make `DifferentialPair` able to nest. (#2477)Yong He
2022-10-27Rename 'IDifferentiable.zero' -> `IDifferentiable.dzero`. (#2474)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2022-10-27Rename `[__custom_jvp]` -> `[ForwardDerivative]`. (#2473)Yong He
* Rename `[__custom_jvp]` -> `[ForwardDerivative]`. * Rename the classes. * More renaming. Co-authored-by: Yong He <yhe@nvidia.com>
2022-10-27Rename `JVPDerivativeModifier` -> `ForwardDifferentiableAttribute`. (#2472)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2022-10-27Auto synthesis of IDifferntial interface methods. (#2469)Yong He
* Auto synthesis of IDifferntial interface methods. * Add comments. Co-authored-by: Yong He <yhe@nvidia.com>
2022-10-26Adding a differentiable standard library (#2465)Sai Praveen Bangaru
2022-10-26Auto synthesis of Differential type (#2466)Yong He
2022-10-20Modified the new type system to support generic differentiable types … (#2413)Sai Praveen Bangaru
* Modified the new type system to support generic differentiable types and added support for differentiating overloaded functions. * Changed a few asserts to release asserts to avoid unreferenced variable errors * Fixed a naming issue with TypeWitnessBreadcumb::Flavor::Decl * Added logic to avoid tracking differentiable types if the module does not use auto-diff or define differentiable types. * Moved the auto-diff passes to after the specialization step, added a more complex generics test * Added a generics stress test and fixed AST-side logic. IR side needs some more work * Added differential getter and setter logic, fixed multiple issues with DifferentiableTypeDictionary, added support for loops and conditions * Changed differential getters to use pointer types, added getter type checking * Fixed some bugs related to diff type registration and differential getters * Removed some superfluous code * Removed some more unused code. * Fixed an issue with witness substitution * Minor fix Co-authored-by: Yong He <yonghe@outlook.com>
2022-08-05Added a new differential type system and various improvements (#2343)Sai Praveen Bangaru
* Merge slang-ir-diff-jvp.cpp * Added support and tests for other float vector types * Added swizzle test and code to handle it (tests failing currently) * Fixed one test, the other is still pending * Fixed instruction cloning logic to avoid modifying original function * Fixed an issue with custom 'pow_jvp' and added support for vector contructor * Minor update to comments * Fixed support for division * Fixed an issue with uninitialized diagnostic sink * Moved derivative processing to after mandatory inlining. Skip instructions that don't have side-effects and aren't used by anything. * WIP: Handling unconditional control flow and multi-block functions * Support for unconditional multi-block functions * Added a dead code elimination step to the derivative pass * Changed name of 'hasNoSideEffects()' * Refactored variable names * Added initial IR defs for new type system * Added necessary logic for semantic checking * Overhauled type system to use builtin pair types and conform to the IDifferentiable interface * Automatically replace IRDifferentiablePairType to a custom IRStructType * Added generics handling by expanding the conformance context functionality and allowing for type parameters * Minor fix: early return in processPairTypes() * Minor fixes to differentiable resolution on generic types * Added new instructions for differential pairs. Basic tests work now. Looking into generic types. * Adjusted most tests to the new type system. OutType and InOutType are still not properly working. * Updated __jvp to produce both primal and differential output * Moved autodiff related declarations to diff.meta.slang * Refactored variable names * Added initial IR defs for new type system * Added necessary logic for semantic checking * Overhauled type system to use builtin pair types and conform to the IDifferentiable interface * Automatically replace IRDifferentiablePairType to a custom IRStructType * Added generics handling by expanding the conformance context functionality and allowing for type parameters * Minor fix: early return in processPairTypes() * Minor fixes to differentiable resolution on generic types * Added new instructions for differential pairs. Basic tests work now. Looking into generic types. * Adjusted most tests to the new type system. OutType and InOutType are still not properly working. * Updated __jvp to produce both primal and differential output * Moved autodiff related declarations to diff.meta.slang * Removed external changes * Cleanup the transcription logic: each case returns a pair of insts for the primal and differential computation.