Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
1cd16ff
Add support for fp16 operators: add, sub, mul, fma, abs and neg
testhound Feb 16, 2022
3efd4fe
Correctly name classes for unary operators
testhound Feb 16, 2022
6c69b2c
Add support for inplace binary operators
testhound Feb 17, 2022
5188b28
Merge branch 'main' into testhound/fp16-operators1
testhound Feb 17, 2022
5b721ad
Change to use AbstractTemplate
testhound Mar 3, 2022
87b8c2c
Use ConcreteTemplate for intrinsics and AbstractTemplate for operators
testhound Mar 4, 2022
6809886
Merge branch 'main' into testhound/fp16-operators1
testhound Mar 4, 2022
7b36527
User @register_global to register operator lowering functions, update…
testhound Apr 15, 2022
9269ff7
Merge branch 'main' into testhound/fp16-operators1
testhound Apr 15, 2022
227ca5b
Fix registration of 'abs', add test cases to verify fp16 operators ar…
testhound Apr 15, 2022
fac30e2
Handle different argument types correctly for binary operators
testhound May 12, 2022
db03e4d
Merge branch 'main' into testhound/fp16-operators1
testhound May 12, 2022
5898b6b
Allow safe promotions and safe conversions for fp16 operators
testhound Jun 6, 2022
527973c
Add fp16 mixed type test for binary operators
testhound Jun 7, 2022
f10a4e5
Merge branch 'main' into testhound/fp16-operators1
testhound Jul 5, 2022
882ea3d
Document need for AbstractTemplate and ConcreateTemplate
testhound Jul 8, 2022
0b244ea
Seed RNG and pass additional paramater to self.subTest:
testhound Jul 8, 2022
a7129d4
Merge branch 'main' into testhound/fp16-operators1
testhound Jul 8, 2022
e1783fa
Merge branch 'main' into testhound/fp16-operators1
testhound Jul 25, 2022
7a7ad7d
Update comment description to recommendation by @gmarkall
testhound Jul 26, 2022
b2bef05
Add new case for function resolution of fp16 unary and binary operators
testhound Jul 26, 2022
021503f
Merge branch 'main' into testhound/fp16-operators1
testhound Jul 28, 2022
f26d289
Skip test if nvvm is not available
testhound Jul 29, 2022
8932a70
Simplify test cases and remove redundant assignments, fix comments
testhound Aug 17, 2022
a19874d
Merge branch 'main' into testhound/fp16-operators1
testhound Aug 17, 2022
fbc183d
Merge comments for binary and comparison fp16 operators
testhound Aug 19, 2022
cfeb49c
Merge branch 'main' into testhound/fp16-operators1
testhound Aug 19, 2022
aa4835c
Merge branch 'main' into testhound/fp16-operators1
testhound Sep 1, 2022
dd8498e
Add back erroneously removed skip if compute compatability is less th…
testhound Sep 6, 2022
277cf08
Merge branch 'main' into testhound/fp16-operators1
testhound Sep 6, 2022
224bd48
Skip tests unless cc >= 5.3
testhound Sep 8, 2022
95670b0
Merge branch 'main' into testhound/fp16-operators1
testhound Sep 8, 2022
ce23094
Streamline code by assing assertEqual
testhound Sep 9, 2022
8a96ff7
Merge branch 'main' into testhound/fp16-operators1
testhound Sep 12, 2022
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
Prev Previous commit
Next Next commit
Add support for inplace binary operators
  • Loading branch information
testhound committed Feb 17, 2022
commit 6c69b2ccd048fbffd53a14b211340981969818ba
6 changes: 3 additions & 3 deletions numba/cuda/cudadecl.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,17 +366,17 @@ class Cuda_fp16_binary(ConcreteTemplate):
class FP16BinOp(ConcreteTemplate):
cases = [signature(types.float16, types.float16, types.float16)]


@register_global(operator.iadd)
@register_global(operator.add)
class BinOpFP16Add(FP16BinOp):
pass


@register_global(operator.isub)
@register_global(operator.sub)
class BinOpFP16Sub(FP16BinOp):
pass


@register_global(operator.imul)
@register_global(operator.mul)
class BinOpFP16Mul(FP16BinOp):
pass
Expand Down
3 changes: 3 additions & 0 deletions numba/cuda/cudaimpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,10 +490,13 @@ def ptx_fp16_binary(context, builder, sig, args):

lower_fp16_binary(stubs.fp16.hadd, 'add')
lower_fp16_binary(operator.add, 'add')
lower_fp16_binary(operator.iadd, 'add')
Comment thread
gmarkall marked this conversation as resolved.
Resolved
lower_fp16_binary(stubs.fp16.hsub, 'sub')
lower_fp16_binary(operator.sub, 'sub')
lower_fp16_binary(operator.isub, 'sub')
lower_fp16_binary(stubs.fp16.hmul, 'mul')
lower_fp16_binary(operator.mul, 'mul')
lower_fp16_binary(operator.imul, 'mul')


@lower(stubs.fp16.hneg, types.float16)
Expand Down