-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic support of jax.lax.scatter ops in TessellateIPU.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright (c) 2023 Graphcore Ltd. All rights reserved. | ||
from typing import Any, Dict, List, Tuple | ||
|
||
import numpy as np | ||
from jax.core import Primitive, ShapedArray | ||
from jax.lax import ( | ||
GatherScatterMode, | ||
ScatterDimensionNumbers, | ||
scatter_add_p, | ||
scatter_max_p, | ||
scatter_min_p, | ||
scatter_mul_p, | ||
) | ||
|
||
from tessellate_ipu.core import ( | ||
IpuTileMapEquation, | ||
make_ipu_vertex_attributes, | ||
make_ipu_vertex_in_info, | ||
make_ipu_vertex_name_templated, | ||
make_ipu_vertex_out_info, | ||
register_ipu_tile_primitive, | ||
) | ||
from tessellate_ipu.utils import DTypeLike | ||
|
||
|
||
def make_gather_vertex_fullname(dtype: DTypeLike) -> str: | ||
"""Generate popops Gather/MultiSlice vertex name.""" | ||
basename = "popops::MultiSlice" | ||
return make_ipu_vertex_name_templated(basename, dtype) |