-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cd3e64e
commit ec123bf
Showing
16 changed files
with
135 additions
and
170 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
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
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
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
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
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
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 |
---|---|---|
@@ -1,5 +1,34 @@ | ||
# SPDX-FileCopyrightText: (c) 2024 Tenstorrent AI ULC | ||
# SPDX-FileCopyrightText: (c) 2025 Tenstorrent AI ULC | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# TODO add tests for `stablehlo.and`. | ||
import jax | ||
import jax.numpy as jnp | ||
import pytest | ||
from infra import random_tensor, run_op_test | ||
from utils import TestCategory, convert_output_to_bfloat16 | ||
|
||
|
||
@pytest.mark.push | ||
@pytest.mark.nightly | ||
@pytest.mark.record_test_properties( | ||
test_category=TestCategory.OP_TEST.value, | ||
jax_op_name="jax.numpy.logical_and", | ||
shlo_op_name="stablehlo.and{LOGICAL}", | ||
) | ||
@pytest.mark.parametrize( | ||
["shape"], | ||
[ | ||
[(32, 32)], | ||
[(64, 64)], | ||
], | ||
ids=lambda val: f"{val}", | ||
) | ||
def test_logical_and(shape: tuple): | ||
@convert_output_to_bfloat16 | ||
def logical_and(a: jax.Array, b: jax.Array) -> jax.Array: | ||
return jnp.logical_and(a, b) | ||
|
||
lhs = random_tensor(shape, jnp.int32, minval=0, maxval=2, random_seed=3) | ||
rhs = random_tensor(shape, jnp.int32, minval=0, maxval=2, random_seed=6) | ||
run_op_test(logical_and, [lhs, rhs]) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,33 @@ | ||
# SPDX-FileCopyrightText: (c) 2024 Tenstorrent AI ULC | ||
# SPDX-FileCopyrightText: (c) 2025 Tenstorrent AI ULC | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# TODO add tests for `stablehlo.not`. | ||
import jax | ||
import jax.numpy as jnp | ||
import pytest | ||
from infra import random_tensor, run_op_test | ||
from utils import TestCategory, convert_output_to_bfloat16 | ||
|
||
|
||
@pytest.mark.push | ||
@pytest.mark.nightly | ||
@pytest.mark.record_test_properties( | ||
test_category=TestCategory.OP_TEST.value, | ||
jax_op_name="jax.numpy.logical_not", | ||
shlo_op_name="stablehlo.not{LOGICAL}", | ||
) | ||
@pytest.mark.parametrize( | ||
["shape"], | ||
[ | ||
[(32, 32)], | ||
[(64, 64)], | ||
], | ||
ids=lambda val: f"{val}", | ||
) | ||
def test_logical_not(shape: tuple): | ||
@convert_output_to_bfloat16 | ||
def logical_not(a: jax.Array) -> jax.Array: | ||
return jnp.logical_not(a) | ||
|
||
input = random_tensor(shape, jnp.int32, minval=0, maxval=2, random_seed=3) | ||
run_op_test(logical_not, [input]) |
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 |
---|---|---|
@@ -1,5 +1,34 @@ | ||
# SPDX-FileCopyrightText: (c) 2024 Tenstorrent AI ULC | ||
# SPDX-FileCopyrightText: (c) 2025 Tenstorrent AI ULC | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# TODO add tests for `stablehlo.or`. | ||
import jax | ||
import jax.numpy as jnp | ||
import pytest | ||
from infra import random_tensor, run_op_test | ||
from utils import TestCategory, convert_output_to_bfloat16 | ||
|
||
|
||
@pytest.mark.push | ||
@pytest.mark.nightly | ||
@pytest.mark.record_test_properties( | ||
test_category=TestCategory.OP_TEST.value, | ||
jax_op_name="jax.numpy.logical_or", | ||
shlo_op_name="stablehlo.or{LOGICAL}", | ||
) | ||
@pytest.mark.parametrize( | ||
["shape"], | ||
[ | ||
[(32, 32)], | ||
[(64, 64)], | ||
], | ||
ids=lambda val: f"{val}", | ||
) | ||
def test_logical_or(shape: tuple): | ||
@convert_output_to_bfloat16 | ||
def logical_or(a: jax.Array, b: jax.Array) -> jax.Array: | ||
return jnp.logical_or(a, b) | ||
|
||
lhs = random_tensor(shape, jnp.int32, minval=0, maxval=2, random_seed=3) | ||
rhs = random_tensor(shape, jnp.int32, minval=0, maxval=2, random_seed=6) | ||
run_op_test(logical_or, [lhs, rhs]) |
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
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 |
---|---|---|
@@ -1,5 +1,34 @@ | ||
# SPDX-FileCopyrightText: (c) 2024 Tenstorrent AI ULC | ||
# SPDX-FileCopyrightText: (c) 2025 Tenstorrent AI ULC | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# TODO add tests for `stablehlo.xor`. | ||
import jax | ||
import jax.numpy as jnp | ||
import pytest | ||
from infra import random_tensor, run_op_test | ||
from utils import TestCategory, convert_output_to_bfloat16 | ||
|
||
|
||
@pytest.mark.push | ||
@pytest.mark.nightly | ||
@pytest.mark.record_test_properties( | ||
test_category=TestCategory.OP_TEST.value, | ||
jax_op_name="jax.numpy.logical_xor", | ||
shlo_op_name="stablehlo.xor{LOGICAL}", | ||
) | ||
@pytest.mark.parametrize( | ||
["shape"], | ||
[ | ||
[(32, 32)], | ||
[(64, 64)], | ||
], | ||
ids=lambda val: f"{val}", | ||
) | ||
def test_logical_xor(shape: tuple): | ||
@convert_output_to_bfloat16 | ||
def logical_xor(a: jax.Array, b: jax.Array) -> jax.Array: | ||
return jnp.logical_xor(a, b) | ||
|
||
lhs = random_tensor(shape, jnp.int32, minval=0, maxval=2, random_seed=3) | ||
rhs = random_tensor(shape, jnp.int32, minval=0, maxval=2, random_seed=6) | ||
run_op_test(logical_xor, [lhs, rhs]) |
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