diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2024-10-25 21:12:37 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-25 21:12:37 -0700 |
| commit | a508b264eda4bc3c99ba1f44eab1dec6e5ce06c0 (patch) | |
| tree | 717722aefcae6b2a5adbccfbcd8aece4ed81f0b7 /docs/design/autodiff/types.md | |
| parent | 49c691e86862d092cd389a02beb4003ee59a4417 (diff) | |
Swap the term StdLib with Core-Module or Standard-Module in documents (#5414)
This PR is limited to documents.
All use of "Standard library" or "StdLib" are replaced with either "core module" or "standard modules", depending on the context.
Diffstat (limited to 'docs/design/autodiff/types.md')
| -rw-r--r-- | docs/design/autodiff/types.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/design/autodiff/types.md b/docs/design/autodiff/types.md index 12b468a6e..2655b5c25 100644 --- a/docs/design/autodiff/types.md +++ b/docs/design/autodiff/types.md @@ -8,7 +8,7 @@ Here we detail the main components of the type system: the `IDifferentiable` int We also detail how auto-diff operators are type-checked (the higher-order function checking system), how the `no_diff` decoration can be used to avoid differentiation through attributed types, and the derivative data flow analysis that warns the the user of unintentionally stopping derivatives. ## `interface IDifferentiable` -Defined in core.meta.slang, `IDifferentiable` forms the basis for denoting differentiable types, both within the stdlib, and otherwise. +Defined in core.meta.slang, `IDifferentiable` forms the basis for denoting differentiable types, both within the core module, and otherwise. The definition of `IDifferentiable` is designed to encapsulate the following 4 items: 1. `Differential`: The type of the differential value of the conforming type. This allows custom data-structures to be defined to carry the differential values, which may be optimized for space instead of relying solely on compiler synthesis/ @@ -110,7 +110,7 @@ void bwd_myFunc<T:IDifferentiable>( Existential types are interface-typed values, where there are multiple possible implementations at run-time. The existential type carries information about the concrete type at run-time and is effectively a 'tagged union' of all possible types. #### Differential type of an Existential -The differential type of an existential type is tricky to define since our type system's only restriction on the `.Differential` type is that it also conforms to `IDifferentiable`. The differential type of any interface `IInterface : IDifferentiable` is therefore the interface type `IDifferentiable`. This is problematic since Slang generally requires a static `anyValueSize` that must be a strict upper bound on the sizes of all conforming types (since this size is used to allocate space for the union). Since `IDifferentiable` is defined in the stdlib `core.meta.slang` and can be used by the user, it is impossible to define a reliable bound. +The differential type of an existential type is tricky to define since our type system's only restriction on the `.Differential` type is that it also conforms to `IDifferentiable`. The differential type of any interface `IInterface : IDifferentiable` is therefore the interface type `IDifferentiable`. This is problematic since Slang generally requires a static `anyValueSize` that must be a strict upper bound on the sizes of all conforming types (since this size is used to allocate space for the union). Since `IDifferentiable` is defined in the core module `core.meta.slang` and can be used by the user, it is impossible to define a reliable bound. We instead provide a new **any-value-size inference** pass (`slang-ir-any-value-inference.h`/`slang-ir-any-value-inference.cpp`) that assembles a list of types that conform to each interface in the final linked IR and determines a relevant upper bound. This allows us to ignore types that conform to `IDifferentiable` but aren't used in the final IR, and generate a tighter upper bound. **Future work:** |
