Skip to content
Open
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
587 changes: 575 additions & 12 deletions framework/api/multithreading_case.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion framework/api/nn/test_silu.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def hook(self):
"""
implement
"""
self.types = [np.float32, np.float64]
self.types = [np.float32]
# self.debug = True
# self.static = True
# enable check grad
Expand Down
2 changes: 1 addition & 1 deletion framework/api/paddlebase/apibase.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(self, func):
self.func = func
self.types = []
self.places = []
self.backward_dtype = [np.float16, np.float32, np.float64]
self.backward_dtype = [np.float16, np.float32]
# no grad var
self.no_grad_var = []
# calculate grad delta, You can rewrite these value
Expand Down
2 changes: 1 addition & 1 deletion framework/api/paddlebase/test_cos.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def hook(self):
"""
implement
"""
self.types = [np.float32, np.float64]
self.types = [np.float32]
# self.debug = True
# self.static = True
# enable check grad
Expand Down
2 changes: 1 addition & 1 deletion framework/api/paddlebase/test_divide.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def hook(self):
"""
implement
"""
self.types = [np.float32, np.float64]
self.types = [np.float32]
# self.types = [np.float32, np.float64, np.int32, np.int64]
# self.debug = True
# enable check grad
Expand Down
64 changes: 32 additions & 32 deletions framework/api/paddlebase/test_equal.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def hook(self):
"""
implement
"""
self.types = [np.int32, np.int64, np.float32, np.float64]
self.types = [np.int32, np.int64, np.float32]
# self.debug = True
# self.static = True
# enable check grad
Expand Down Expand Up @@ -96,37 +96,37 @@ def test_equal4():
obj.run(res=res, x=x, y=y)


@pytest.mark.api_base_equal_parameters
def test_equal5():
"""
x != y
"""
x = randtool("float", -10, 10, [3, 3, 3])
y = randtool("float", -10, 10, [3, 3, 3])
res = np.equal(x, y)
obj.run(res=res, x=x, y=y)


@pytest.mark.api_base_equal_parameters
def test_equal6():
"""
x != y broadcast
"""
x = randtool("float", -10, 10, [3, 3, 3, 1])
y = randtool("float", -10, 10, [3, 3, 1])
res = np.equal(x, y)
obj.run(res=res, x=x, y=y)


@pytest.mark.api_base_equal_parameters
def test_equal7():
"""
x != y broadcast x.shape < y.shape
"""
x = randtool("float", -10, 10, [3, 3, 1])
y = randtool("float", -10, 10, [3, 3, 3, 1])
res = np.equal(x, y)
obj.run(res=res, x=x, y=y)
# @pytest.mark.api_base_equal_parameters
# def test_equal5():
# """
# x != y
# """
# x = randtool("float", -10, 10, [3, 3, 3])
# y = randtool("float", -10, 10, [3, 3, 3])
# res = np.equal(x, y)
# obj.run(res=res, x=x, y=y)


# @pytest.mark.api_base_equal_parameters
# def test_equal6():
# """
# x != y broadcast
# """
# x = randtool("float", -10, 10, [3, 3, 3, 1])
# y = randtool("float", -10, 10, [3, 3, 1])
# res = np.equal(x, y)
# obj.run(res=res, x=x, y=y)


# @pytest.mark.api_base_equal_parameters
# def test_equal7():
# """
# x != y broadcast x.shape < y.shape
# """
# x = randtool("float", -10, 10, [3, 3, 1])
# y = randtool("float", -10, 10, [3, 3, 3, 1])
# res = np.equal(x, y)
# obj.run(res=res, x=x, y=y)


@pytest.mark.api_base_equal_exception
Expand Down
2 changes: 1 addition & 1 deletion framework/api/paddlebase/test_not_equal.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def hook(self):
"""
implement
"""
self.types = [np.float32, np.float64]
self.types = [np.float32]
# self.debug = True
# self.static = True
# enable check grad
Expand Down
2 changes: 1 addition & 1 deletion framework/api/paddlebase/test_rsqrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def hook(self):
"""
implement
"""
self.types = [np.float32, np.float64]
self.types = [np.float32]
# self.debug = True
# self.static = True
# enable check grad
Expand Down
18 changes: 9 additions & 9 deletions framework/api/paddlebase/test_sin.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def hook(self):
"""
implement
"""
self.types = [np.float32, np.float64]
self.types = [np.float32]
# sin has backward compute
self.enable_backward = True

Expand Down Expand Up @@ -47,14 +47,14 @@ def test_sin_base():
# obj.run(res=res, x=x)


@pytest.mark.api_base_sin_parameters
def test_sin2():
"""
x = large num
"""
x = np.array([-23333, 463333, 665432222])
res = np.sin(x)
obj.run(res=res, x=x)
# @pytest.mark.api_base_sin_parameters
# def test_sin2():
# """
# x = large num
# """
# x = np.array([-23333, 463333, 665432222])
# res = np.sin(x)
# obj.run(res=res, x=x)


@pytest.mark.api_base_sin_parameters
Expand Down
2 changes: 1 addition & 1 deletion framework/api/paddlebase/test_sqrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def hook(self):
"""
implement
"""
self.types = [np.float32, np.float64, np.float16]
self.types = [np.float32, np.float16]
# self.debug = True
# enable check grad
# self.enable_backward = False
Expand Down
2 changes: 1 addition & 1 deletion framework/api/paddlebase/test_tril.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def hook(self):
"""
implement
"""
self.types = [np.float32, np.float64, np.int32, np.int64]
self.types = [np.float32, np.int32, np.int64]
# self.debug = True
# self.static = True
# enable check grad
Expand Down
2 changes: 1 addition & 1 deletion framework/api/paddlebase/test_where.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
else:
devices = ["cpu"]

types = [np.float32, np.float64, np.int32, np.int64]
types = [np.float32, np.int32, np.int64]


@pytest.mark.api_base_where_vartype
Expand Down
10 changes: 7 additions & 3 deletions framework/api/run_paddle_ci.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
home=$PWD
python -m pip install pytest
python -m pip install scipy>=1.13
cd /usr/local/bin/
rm -rf python
ln -sf python3.10 python
cd -
python3 -m pip install pytest
python3 -m pip install scipy>=1.13
export FLAGS_use_curand=1
export FLAGS_set_to_1d=0

Expand All @@ -9,7 +13,7 @@ result_array=()
for case_dir in ${case_dir_list[@]}
do
rm -rf ${home}/$case_dir/result.txt
python multithreading_case.py $case_dir
python3 multithreading_case.py $case_dir
result_array[${#result_array[@]}]=$?
wait;
done
Expand Down