Code Monkey home page Code Monkey logo

Comments (5)

SamirDroubi avatar SamirDroubi commented on June 30, 2024 1

What I am generally saying is that if the user asks Exo to do some action A (scheduling, codegen, other?) on some procedure P, then error reporting should be with respect to procedure P which is not always the case right now. The extension of this is what you described: I ask an abstraction to do something on a program P and error reporting should be on P.

from exo.

rachitnigam avatar rachitnigam commented on June 30, 2024

Thanks for writing this up! In general, this is a tricky problem that all compiler (not just rewrite-based ones) have to deal with. Even in a standard compiler, the intermediate representation is derived from normalization of surface constructs which requires the same kind of tracking. There are different trade-offs you can make w.r.t. to the amount of information tracked and the precision of the error messages.

For example, the Rust compiler uses the Diagnostics struct for reporting error messages. The error messages, especially when generated from a type error, often represent a tree of rewrites from source-level AST to the internal representation which allows Rust to provide error messages that meaningful for a particular context.

As a maximalist, strawperson proposal, maybe the thing to do is tracking all of the source information generated when rewriting programs. For example, when a loop is fused, we add a srcinfo node that literally says that this node is derived from these other two loops.

from exo.

SamirDroubi avatar SamirDroubi commented on June 30, 2024

I think the difference here is that I the user was the person who drove the rewrites to this point vs in rust the compiler did so. In Exo, I don't particularly care about the original procedure. I care about where I am at now and where the problem is here.

from exo.

rachitnigam avatar rachitnigam commented on June 30, 2024

Hm, but that assumes that you, as the user, have seen each rewrite. This is not going to be true when using the abstracted scheduling operators. For example, if there is an error in the middle of vectorize, which version of the program should the error be reported on. Ideally we'd want the diagnostics mechanism to have a hook that says "start tracking all the rewrites from now on" and report the transformations that occurred within vectorize, showing the trace of rewritten programs which might give an insight into what caused the error.

A similar problem might arise when building Halide-like automation which parameterizes the lowering process and triggers bound inference on some IR which is not meaningful to someone working with a surface program.

from exo.

SamirDroubi avatar SamirDroubi commented on June 30, 2024

Now we are discussing a different problem. What you are describing is the next problem to solve if we implement what I described above. The confusion I think is that srcinfo in Exo is information about line and column numbers in the Python source file from which the current AST node originated.

from exo.

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.