Git Product home page Git Product logo

Comments (6)

ajbrent avatar ajbrent commented on September 28, 2024 1

Seems like there are a number of functions that are not yet implemented for float8 types on either cpu or cuda:

  1. .item() for cuda
  2. unique for cpu and cuda
  3. torch.index_select for cpu and cuda
  4. torch.equal for cpu
  5. fill_ for cpu
  6. torch.where for cpu and cuda
    That is all I have found so far.
    Would following the same approach as #116806 be sufficient to add float8 support for the above?

from pytorch.

bdhirsh avatar bdhirsh commented on September 28, 2024

Seems like item() on cuda just doesn't support the float8 dtypes yet (which the graph passes in inductor happen to rely on):

# this works for me on cpu, but not on cuda
>>> x = torch.tensor(2, dtype=torch.float8_e4m3fn, device='cuda')
>>> y = x.item()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: "_local_scalar_dense_cuda" not implemented for 'Float8_e4m3fn'

cc @drisspg @vkuzo, should we just add .item() support for float8 cuda?

from pytorch.

vkuzo avatar vkuzo commented on September 28, 2024

yes we should add it, I can take a look but not sure on the timeline, if anyone can get to it sooner happy to help / review the code

from pytorch.

ajbrent avatar ajbrent commented on September 28, 2024

Can I give this a shot?

from pytorch.

eellison avatar eellison commented on September 28, 2024

will let @ajbrent and @vkuzo figure it out

from pytorch.

vkuzo avatar vkuzo commented on September 28, 2024

Would following the same approach as #116806 be sufficient to add float8 support for the above?

Thanks for offering to help! Yes, that approach is reasonable. I'd also say there is no expectation for every op to work for float8. The only numerics changing op with hardware support is a gemm (torch._scaled_mm), and there are other ops which are useful such as torch.cat, item(), etc which do not change numerics. We don't want to add support for things like torch.add with float8 inputs. The ops you listed in the comment above all sound good to me, although I'm not sure I'd prioritize things like unique unless there is a use case.

If you are up for also adding fill_out that would help close #128257!

from pytorch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.