ez icon indicating copy to clipboard operation
ez copied to clipboard

complete all of the callback implementations for Nx.Backend

Open ityonemo opened this issue 5 years ago • 3 comments

  • [ ] iota
  • [ ] random_uniform
  • [ ] random_normal
  • [ ] to_batched_list
  • [x] to_binary
  • [ ] backend_deallocate
  • [ ] backend_transfer
  • [ ] tensor
  • [x] inspect
  • [x] from_binary
  • [ ] as_type
  • [ ] reshape
  • [ ] squeeze
  • [ ] broadcast
  • [ ] transpose
  • [ ] pad
  • [ ] reverse
  • [ ] dot
  • [ ] clip
  • [ ] slice
  • [ ] concatenate
  • [ ] select
  • [ ] conv
  • [ ] all?
  • [ ] any?
  • [ ] sum
  • [ ] product
  • [ ] reduce_max
  • [ ] reduce_min
  • [ ] argmax
  • [ ] argmin
  • [ ] reduce
  • [ ] reduce_window
  • [ ] window_sum
  • [ ] window_product
  • [ ] window_max
  • [ ] window_min
  • [ ] map
  • [ ] sort
  • [ ] cholesky
  • [x] add
  • [ ] subtract
  • [x] multiply
  • [ ] power
  • [ ] remainder
  • [ ] divide
  • [ ] arctan2
  • [ ] min
  • [ ] max
  • [ ] quotient
  • [ ] bitwise_and
  • [ ] bitwise_or
  • [ ] bitwise_xor
  • [ ] left_shift
  • [ ] right_shift
  • [ ] equal
  • [ ] not_equal
  • [ ] greater
  • [ ] less
  • [ ] greater_equal
  • [ ] less_equal
  • [ ] logical_and
  • [ ] logical_or
  • [ ] logical_xor
  • [ ] outer

ityonemo avatar Feb 17 '21 20:02 ityonemo

Can you pick one and write how to complete one of them?

fire avatar Feb 17 '21 20:02 fire

the starter ones are the binary tensor ops, the implementation lives here:

https://github.com/ityonemo/ez/blob/af2dd139d953f42d0f0a3bd4695907ad7bc69db2/lib/ez/zig_slice_backend.ex#L31-L64

tests are here: https://github.com/ityonemo/ez/blob/af2dd139d953f42d0f0a3bd4695907ad7bc69db2/test/ez_test.exs#L15-L61

most of the other tensor ops should be straightforward, but will need a different harness (since they emit a different type, e.g. the boolean ones).

Not sure if reduce or map are possible since those require calling out to elixir or an nx-rewritten ast sort of a thing, but I think it's ultimately doable

ityonemo avatar Feb 17 '21 20:02 ityonemo

related: https://github.com/ityonemo/ez/issues/6

ityonemo avatar Feb 17 '21 20:02 ityonemo