Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

completed reference docs #37

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions docs/Reference/classes/Array/Array.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ Constructs an array.

argument | description | type/default
--- | --- | ---
`role` | The role of the array, which determines if the array scope is internal or external and if the array is mutable or immutable. | [`accera.Array.Role`](<Role.md>)
`data` | The contents of a constant array. Required for `accera.Array,Role.CONST` arrays but should not be specified for other roles. | Python buffer or `numpy.ndarray`
`element_type` | The array element type. | [`accera.ScalarType`](<../../enumerations/ScalarType.md>), default: `accera.ScalarType.float32`
`layout` | The affine memory map. | tuple of integers or [`accera.Array.Layout`](<Layout.md>), default: `accera.Array.Layout.FIRST_MAJOR`
`offset` | The offset of the affine memory map | integer (positive, zero, or negative), default: 0
`role` | The role of the array determines if the array scope is internal or external and if the array is mutable or immutable. | [`accera.Array.Role`](<Role.md>)
`data` | The contents of a constant array. Required for `accera.Array,Role.CONST` arrays but should not be specified for other roles. | Python buffer or `numpy.ndarray`.
`element_type` | The array element type. | [`accera.ScalarType`](<../../enumerations/ScalarType.md>), default: `accera.ScalarType.float32`.
`layout` | The affine memory map. | tuple of integers or [`accera.Array.Layout`](<Layout.md>), default: `accera.Array.Layout.FIRST_MAJOR`.
`offset` | The offset of the affine memory map | integer (positive, zero, or negative), default: 0.
`shape` | The array shape. Required for roles other than `accera.Array.Role.CONST`, should not be specified for `accera.Array.Role.CONST`.

## Examples
Expand Down Expand Up @@ -63,3 +63,5 @@ A = acc.Array(role=acc.Array.Role.TEMP, element_type=acc.ScalarType.float32, sha
```

<div style="page-break-after: always;"></div>


7 changes: 3 additions & 4 deletions docs/Reference/classes/Array/Layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

type | description
--- | ---
`accera.Array.Layout.FIRST_MAJOR` | Specifies a memory layout where the first major axis is in contiguous memory. For example, in a matrix, this corresponds to "row-major"
`accera.Array.Layout.LAST_MAJOR` | Specifies a memory layout where the last major axis is in contiguous memory. For example, in a matrix, this corresponds to "column-major"
`accera.Array.Layout.DEFERRED` | Defer specifying the memory layout for a `Array.Role.CONST` array until a cache is created.

`accera.Array.Layout.FIRST_MAJOR` | Specifies a memory layout where the first major axis is in contiguous memory. For example, in a matrix, this corresponds to "row-major".
`accera.Array.Layout.LAST_MAJOR` | Specifies a memory layout where the last major axis is in contiguous memory. For example, in a matrix, this corresponds to "column-major".
`accera.Array.Layout.DEFERRED` | Defer specifying the memory layout for an `Array.Role.CONST` array until a cache is created.

<div style="page-break-after: always;"></div>
11 changes: 6 additions & 5 deletions docs/Reference/classes/Array/Role.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

type | description
--- | ---
`accera.Array.Role.CONST` | A constant array (immutable internal-scope) whose contents are known at compile-time
`accera.Array.Role.INPUT` | An input array (immutable external-scope)
`accera.Array.Role.INPUT_OUTPUT` | An input/output array (mutable external-scope)
`accera.Array.Role.TEMP` | A temporary array (mutable internal-scope)

`accera.Array.Role.CONST` | A constant array (immutable internally scoped) whose contents are known at compile-time.
`accera.Array.Role.INPUT` | An input array (immutable external-scope).
`accera.Array.Role.INPUT_OUTPUT` | An input/output array (mutable external-scope).
`accera.Array.Role.TEMP` | A temporary array (mutable internal-scope).

<div style="page-break-after: always;"></div>


2 changes: 1 addition & 1 deletion docs/Reference/classes/Nest/iteration_logic.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Adds an iteration logic function to a `Nest`.

argument | description | type/default
--- | --- | ---
`logic` | | Python function that represents the logic to run in the innermost loop of the nest
`logic` | | Python function that represents the logic to run in the innermost loop of the nest.

## Examples

Expand Down
8 changes: 4 additions & 4 deletions docs/Reference/classes/Package/Format.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

type | description
--- | ---
`accera.Package.Format.HAT_DYNAMIC` | HAT package format, dynamically linked
`accera.Package.Format.HAT_STATIC` | HAT package format, statically linked
`accera.Package.Format.MLIR_DYNAMIC` | MLIR (debugging) package format, dynamically linked
`accera.Package.Format.MLIR_STATIC` | MLIR (debugging) package format, statically linked
`accera.Package.Format.HAT_DYNAMIC` | HAT package format, dynamically linked.
`accera.Package.Format.HAT_STATIC` | HAT package format, statically linked.
`accera.Package.Format.MLIR_DYNAMIC` | MLIR (debugging) package format, dynamically linked.
`accera.Package.Format.MLIR_STATIC` | MLIR (debugging) package format, statically linked.

When cross-compiling, use either `accera.Package.Format.HAT_STATIC` or `accera.Package.Format.MLIR_STATIC`.

Expand Down
4 changes: 2 additions & 2 deletions docs/Reference/classes/Package/Mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

type | description
--- | ---
`accera.Package.Mode.DEBUG` | Debug mode (automatically tests logical equivalence)
`accera.Package.Mode.RELEASE` | Release (maximally optimized)
`accera.Package.Mode.DEBUG` | Debug mode (automatically tests logical equivalence).
`accera.Package.Mode.RELEASE` | Release (maximally optimized).


<div style="page-break-after: always;"></div>
4 changes: 3 additions & 1 deletion docs/Reference/classes/Package/add.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Adds one or more functions to the package.
argument | description | type
--- | --- | ---
`source` | The source which defines the function's implementation. | `Nest` or `Schedule` or `Plan`
`args` | The order of external-scope arrays to use in the function signature. | tuple of `Array`
`args` | The order of external-scope arrays used in the function signature. | tuple of `Array`
`base_name` | A base name for the function. The full name for the function will be the base name followed by an automatically-generated unique identifier. | string
`parameters` | A value for each parameter if the function's implementation is parameterized. See [Parameters](<../../../Manual/09%20Parameters.md>). A list of dictionaries can also be provided, in which case, multiple functions are generated.| `Parameter` to value dictionary or a list of `Parameter` to value dictionaries.

Expand Down Expand Up @@ -42,3 +42,5 @@ package.add(nest, args=(A, B, C), parameters={P0:16, P1:16, P2:16, P3:1}, base_n
```

<div style="page-break-after: always;"></div>


4 changes: 3 additions & 1 deletion docs/Reference/classes/Package/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ argument | description | type/default
`name` | The package name. | string
`format` | The format of the package. | `accera.Package.Format`, defaults to `Package.Format.HAT_STATIC`
`mode` | The package mode, such as whether it is optimized or used for debugging. | `robopy.Package.Mode`, defaults to `Package.Mode.Release`
`platform` | The platform where the package will run. | `accera.Package.Platform`
`platform` | The platform where the package runs. | `accera.Package.Platform`
`tolerance` | The tolerance for correctness checking when `mode = Package.Mode.Debug`. | float, defaults to 1e-5
`output_dir` | The path to an output directory. Defaults to the current directory if unspecified. | string

Expand Down Expand Up @@ -62,3 +62,5 @@ package.build(format=acc.Package.Format.HAT_STATIC, name="myPackagePi3", platfor
```

<div style="page-break-after: always;"></div>


4 changes: 3 additions & 1 deletion docs/Reference/classes/Plan/bind.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ argument | description | type/default

## Examples

Mark the `i`, `j`, and `k` indices to execute on an NVidia V100's `BLOCK_X`, `THREAD_X`, and `THREAD_Y` grid axes respectively.
Mark the `i`, `j`, and `k` indices to execute on NVidia V100's `BLOCK_X`, `THREAD_X`, and `THREAD_Y` grid axes, respectively.

```python
v100 = acc.Target(Target.Model.NVIDIA_V100)
Expand All @@ -26,3 +26,5 @@ plan.bind({
```

<div style="page-break-after: always;"></div>


15 changes: 8 additions & 7 deletions docs/Reference/classes/Plan/cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,18 @@ Adds a caching strategy to a plan.

argument | description | type
--- | --- | ---
`source` | The array or cache from which this cache is copied. | `Array` or `Cache`
`index` | The index used to determine the cache level. Specify one and only one of `index`, `level`, `max_elements`. | `Index`
`trigger_index` | The index used to determine what level to fill the cache at. `trigger_index` can't come after `index` in the schedule order, and will default to `index` if not specified. Specify at most one of `trigger_index` or `trigger_level`. | `Index`
`layout` | The affine memory map, if different from the source. | [`accera.Layout`](<../Array/Layout.md>)
`level` | The key-slice level to cache (the number of wildcard dimensions in a key-slice). Specify one and only one of `index`, `level`, `max_elements`. | positive integer
`source` | The array or cache from which this cache is copied. | `Array` or `Cache`.
`index` | The index used to determine the cache level. Specify one and only one of `index`, `level`, `max_elements`. | `Index`.
`trigger_index` | The index used to determine what level to fill the cache at. `trigger_index` can't come after `index` in the schedule order and will default to `index` if not specified. Specify at most one of `trigger_index` or `trigger_level`. | `Index`.
`layout` | The affine memory map, if different from the source. | [`accera.Layout`](<../Array/Layout.md>).
`level` | The key-slice level to cache (the number of wildcard dimensions in a key-slice). Specify one and only one of `index`, `level`, `max_elements`. | positive integer.
`trigger_level` | The key-slice level to fill the cache at. `trigger_level` can't be smaller than `level`, and will default to `level` if not specified. Specify at most one of `trigger_index` or `trigger_level`. | positive integer
`max_elements` | The maximum elements to include in the cached region. Specify one and only one of `index`, `level`, `max_elements`. | positive integer
`thrifty` | Use thrifty caching (copy data into a cache only if the cached data differs from the original active block). | `bool`
`location` | The type of memory used to store the cache. | `MemorySpace`
`double_buffer` | Whether to make this cache a double-buffering cache. Only valid on INPUT and CONST arrays. | `bool`
`double_buffer_location` | Which memory space to put the double buffer temp array in. Requires that double_buffer is set to True. Defaults to `AUTO`. | `MemorySpace` or `AUTO`
`vectorize` | Whether to vectorize the cache operations. Defaults to `AUTO`, which will behave like `vectorize=True` if the loopnest has any vectorized loop via `plan.vectorize(index)` or `vectorize=False` if the loopnest has no vectorized loops. | `bool`

`vectorize` | Whether to vectorize the cache operations. Defaults to `AUTO`, which will behave like `vectorize=True` if the loop-nest has any vectorized loop via `plan.vectorize(index)` or `vectorize=False` if the loop-nest has no vectorized loops. | `bool`

`AUTO` will configure the double buffering location based on the following:
`location` | `double_buffer` | `double_buffer_location` = `AUTO`
Expand Down Expand Up @@ -68,3 +67,5 @@ AA = plan.cache(A, i, location=v100.MemorySpace.SHARED)
```

<div style="page-break-after: always;"></div>


10 changes: 6 additions & 4 deletions docs/Reference/classes/Plan/kernelize.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
# Accera v1.2.3 Reference

## `accera.Plan.kernelize(unroll_indices[, vectorize_indices])`
A convenience method for a sequence of `unroll` instructions followed by a possible sequence of `vectorize` instructions
A convenience method for a sequence of `unroll` instructions followed by a possible sequence of `vectorize` instructions.

## Arguments

argument | description | type/default
--- | --- | ---
`unroll_indices` | The iteration-space dimensions to unroll | tuple of `accera.Index`
`vectorize_indices` | The optional iteration-space dimensions to vectorize | `accera.Index` or tuple of `accera.Index`
`unroll_indices` | The iteration-space dimensions to unroll | tuple of `accera.Index`.
`vectorize_indices` | The optional iteration-space dimensions to vectorize | `accera.Index` or tuple of `accera.Index`.

## Examples

Expand All @@ -23,7 +23,7 @@ plan = schedule.create_plan()
plan.kernelize(unroll_indices=(i, k), vectorize_indices=j)
```

Another example is to Unroll `i`, and then vectorize `j` and `k`:
Another example is to Unroll `i` and then vectorize `j` and `k`:

```python
schedule.reorder(i, j, k)
Expand All @@ -32,3 +32,5 @@ plan.kernelize(unroll_indices=(i,), vectorize_indices=(j, k))
```

<div style="page-break-after: always;"></div>


6 changes: 4 additions & 2 deletions docs/Reference/classes/Plan/parallelize.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

## `accera.Plan.parallelize(indices[, pin, policy])`

Performs one or more loops in parallel on multiple cores or processors.
Executes one or more loops in parallel on multiple cores or processors.

Only available for targets with multiple cores or processors.

Expand All @@ -15,7 +15,7 @@ argument | description | type/default
--- | --- | ---
`indices` | The iteration-space dimensions to run in parallel. To assign multiple threads to an index, first split that index, then parallelize its split indices. <br/> Unsplit indices will be assigned one thread each, split indices will be assigned threads based on the number of split blocks. This is limited by the number of threads supported by the target. | tuple of `accera.Index`
`pin` | Pin the computation to a subset of cores or processors. | tuple of target-specific identifiers
`policy` | The scheduling policy to apply ("dynamic" or "static"). | string. Defaults to "static"
`policy` | The scheduling policy to apply ("dynamic" or "static"). | string. Defaults to "static".

## Examples

Expand Down Expand Up @@ -51,3 +51,5 @@ plan.parallelize(indices=(i, j, k), policy="dynamic")
```

<div style="page-break-after: always;"></div>


5 changes: 3 additions & 2 deletions docs/Reference/classes/Plan/tensorize.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
# Accera v1.2.3 Reference

## `accera.Plan.tensorize(indices)`
Only available for targets that have native matrix multiplication instruction (tensor core) support. Marks the dimensions of the iteration-space for tensorization. Only perfectly nested loops of the following form can be tensorized:

Only available for targets with native matrix multiplication instruction (tensor core) support. Marks the dimensions of the iteration-space for tensorization. Only perfectly nested loops of the following form can be tensorized:

```python
for i in range(M):
Expand All @@ -29,3 +28,5 @@ plan.tensorize(indices=(ii,jj,kk))
```

<div style="page-break-after: always;"></div>


2 changes: 1 addition & 1 deletion docs/Reference/classes/Schedule/create_plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Accera v1.2.3 Reference

## `accera.Schedule.create_plan([target])`
Create a plan for the nest.
Creates a plan for running this schedule.

## Arguments

Expand Down
4 changes: 3 additions & 1 deletion docs/Reference/classes/Schedule/reorder.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ These orders are not allowed:

argument | description | type/default
--- | --- | ---
`order` | Either the order of indices to set, or the outermost index if using variable arguments | tuple of `Index` or `Index`
`order` | Either the order of indices to set or the outermost index if using variable arguments | tuple of `Index` or `Index`.
`*args` | Optional variable arguments containing subsequent indices to set | variable `Index` arguments

## Examples
Expand All @@ -33,3 +33,5 @@ schedule.reorder(order=(k, i, j))


<div style="page-break-after: always;"></div>


4 changes: 3 additions & 1 deletion docs/Reference/classes/Schedule/skew.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Accera v1.2.3 Reference

## `accera.Schedule.skew(index, reference_index [, unroll_loops_smaller_than])`
Transform a dimension with respect to a reference dimension into a parallelogram by padding with empty elements.
Transforms a dimension with respect to a reference dimension into a parallelogram by padding with empty elements.

## Arguments

Expand All @@ -29,3 +29,5 @@ schedule.skew(j, i, unroll_loops_smaller_than=3)
```

<div style="page-break-after: always;"></div>


2 changes: 2 additions & 0 deletions docs/Reference/classes/Schedule/split.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ ii = schedule.split(j, 5)
```

<div style="page-break-after: always;"></div>


6 changes: 4 additions & 2 deletions docs/Reference/classes/Schedule/tile.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ argument | description | type/default
`shape` | Mapping of indices to tile sizes | dict of `Index` and non-negative integers

## Returns
Tuple of `Index` representing the new inner dimensions
Tuple of `Index` representing the new inner dimensions.

## Examples

Tile the `i`, `j`, and `k` dimensions by 8, 2, and 3 respectively
Tile the `i`, `j`, and `k` dimensions by 8, 2, and 3, respectively.

```python
ii, jj, kk = schedule.tile({
Expand All @@ -28,3 +28,5 @@ ii, jj, kk = schedule.tile({
```

<div style="page-break-after: always;"></div>


Loading