summaryrefslogtreecommitdiff
path: root/tests/autodiff/generic-jvp.slang
AgeCommit message (Collapse)Author
2025-08-06Fix 7723 - Add autodiff tests (#7919)Harsh Aggarwal (NVIDIA)
* Fix 7723 - Add autodiff tests * Update bug-1.slang Adding Vulkan
2024-08-26Correct the `generic-jvp.slang` test (#4900)ArielG-NV
Fixes: #4899 Fixes invalid test results since `{...}` was differentiating the constructor of `myvector` when it should not (see #4877). This change modifies the test so it is correct so other PRs may be merged if indirectly/directly fixing the old use-case for this test.
2023-07-26Refactor `dmul(This, Differential)` to `dmul<T:Real>(T, Differential)` (#3029)Sai Praveen Bangaru
* Refactor `dmul(This, Differential)` to `dmul<T:Real>(T, Differential)` - Add AST synthesis support for generic containers - Refactor relevant tests * Merge dmul synthesis with dadd and dzero, and disambiguate using an enum * Fix trailing spaces
2022-11-23Make differentiable data-flow pass recognize interface methods. (#2530)Yong He
* Make differentiable data-flow pass recognize interface methods. * Make existing test to work with `[TreatAsDifferentiable]`. Co-authored-by: Yong He <yhe@nvidia.com>
2022-11-04Use property for `DifferentialPair` accessors. (#2493)Yong He
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 `JVPDerivativeModifier` -> `ForwardDifferentiableAttribute`. (#2472)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2022-10-27Rename `__jvp`-->`__fwd_diff`. (#2471)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2022-10-24Rework differentiation of member access through ↵Yong He
`[DerivativeMember(DiffType.field)]` (#2460) * wip: remove auto-diff for member access, add diff through property accessors. * Fix getter-setter test. * Fix getter-setter-multi test. * Fix nested-jvp test. * Use [DerivativeMember] attribute to differentiate through member access. * Clean up. * More cleanup. Co-authored-by: Yong He <yhe@nvidia.com>
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.