Comments (8)
I'm helping set up the Python bindings for trial use in Fredo's class. Promoting user input errors to some catchable mechanism would make the user experience in Python, in particular, much better (it could show at least a Python stack trace, and would not instantly exit(1)
the REPL when coding interactively).
from halide.
By user input errors do you mean parameters that are bad or code that
cannot be compiled? The former should be catchable via overriding
halide_error to catch the error messages. If it is called, that means an
error occured. Making all this happen in a thread safe manner is ugly, but
doable.
I'm guessing I'm missing something...
On Wed, Nov 13, 2013 at 3:08 PM, Jonathan Ragan-Kelley <
[email protected]> wrote:
I'm helping set up the Python bindings for trial use in Fredo's class.
Promoting user input errors to some catchable mechanism would make the user
experience in Python, in particular, much better (it could show at least a
Python stack trace, and would not instantly exit(1) the REPL when coding
interactively).—
Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-28443579
.
from halide.
This is a reference to our past private thread on “Halide error reporting.”
I mean user input errors at the compiler API level (constructing IR or schedules that don’t make sense, or otherwise incorrectly using the interfaces). We throw asserts with error strings not just for “oh my god, the compiler is going to blow up” invariants we maintain internally, but also for bad inputs created by user code. It would be useful if these user-gave-us-something-bad errors followed a different path from our-code-confused-itself-internally asserts, in part so that the errors can be caught rather than exiting the host program.
from halide.
I’m glad to take an initial crack at it, if people buy that a trivial design is a worthwhile change. I’m just replacing existing asserts which relate mostly to user input with some alternate function like:
inline void Halide::Internal::user_assert(bool condition, string message)
This function could:
- print and exit(1) (existing assert behavior)
- raise an exception
- do something else
I’m assuming (1) by default for now, with either #ifdef
s or runtime flags to change to (2).
Is this worthwhile, or would people rather continue waiting for a full rethink of the compiler error handling stack as discussed off-list in July?
from halide.
I buy that the trivial design is a worthwhile change.
On Wed, Nov 13, 2013 at 3:34 PM, Jonathan Ragan-Kelley <
[email protected]> wrote:
I’m glad to take an initial crack at it, if people buy that a trivial
design is a worthwhile change. I’m just replacing existing asserts which
relate mostly to user input with some alternate function like:inline void Halide::Internal::user_assert(bool condition, string message)
This function could:
- print and exit(1) (existing assert behavior)
- raise an exception
- do something else
I’m assuming (1) by default for now, with either #ifdefs or runtime flags
to change to (2).Is this worthwhile, or would people rather continue waiting for a full
rethink of the compiler error handling stack as discussed off-list in July?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-28445379
.
from halide.
A prototype of a more extensive rework of error conditions is in the introspection branch. It does a superset of the above.
from halide.
merged into trunk in 525176e
from halide.
Much like.
from halide.
Related Issues (20)
- Target() should fail on obviously-wrong feature combinations
- "Update definition 0 of function foo has not been scheduled" warnings should be errors HOT 7
- fuzz-testing failure in fuzz-cse HOT 3
- Anderson2021 does not work with multiple outputs
- "string typing" in Halide IR names should at least have a glossary
- Incorrect semaphore placement in the chain of async producers HOT 1
- Serialization feature needs Python API
- Too strict warning (meshgrid)? HOT 5
- RoundUpAndBlend and ShiftInwardsAndBlend should be legal options when splitting RVars
- [PTX] Target integer math intrinsics
- Should we offer export-to-WebAssembly-Component? HOT 1
- LLVM `TargetMachine ::registerPassBuilderCallbacks` interface is changed HOT 2
- Error: Can't treat this multidimensional RDom as an Expr: HOT 4
- simd_op_check output has productivity issues.
- Add storage folding support to buffers HOT 3
- Export bounds from pipelines symbolically HOT 4
- Wasm testing has been broken for a few weeks HOT 3
- Internal Error that may related to ShiftInWards or nested vectorization HOT 1
- Vectorization for reduction domain in Halide::argmax
- Internal Error triggered by vectorization HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from halide.