Code Monkey home page Code Monkey logo

Comments (4)

harsh-nod avatar harsh-nod commented on August 22, 2024

I came up a simpler test case.

import torch
import torch_mlir

torch_mlir.debug_trace_to_stderr()

mb = torch_mlir.ModuleBuilder()
N = 10
with mb.capture_function("arange_test", []) as f:
    x = torch.arange(N)
    f.returns([x])

It seems that even though the dispatch is going to the fallback kernel, when in the dispatcher::callBoxed function, the dispatchKey is c10::DispatchKey::Undefined which means that pytorch is unable to find a boxed implementation for this op. It seems like we might have to implement this op just like you implemented the copyUnderKernel. What do you think?

from torch-mlir.

stellaraccident avatar stellaraccident commented on August 22, 2024

Thanks - I believe that this gets routed to the "backendSelect" dispatch key, which is used for kernels that don't have tensor arguments (a heuristic on tensor arguments is what drives dispatch key selection). I know roughly what goes on there but this is the first I've run in to fixing it. I've got a version of PyTorch that dumps all of the dispatch metadata, which helps in these "where'd the kernel go" diagnoses. I just sent out/landed the other PRs and my queue is clear now. Let me take some time tomorrow to triage these (great!) test cases you've come up with.

from torch-mlir.

stellaraccident avatar stellaraccident commented on August 22, 2024

This appears to be a specific problem with kernels that have out parameters: aten::arange.start_out(Scalar start, Scalar end, Scalar step=1, *, Tensor(a!) out) -> (Tensor(a!))

The sequence on the stack is not as expected and something is getting inverted.

from torch-mlir.

stellaraccident avatar stellaraccident commented on August 22, 2024

Actually, looking at blame logs, may have been fixed two days ago (yay for procrastination). Rebasing and seeing...

from torch-mlir.

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.