Skip to content

calyx-py: Separate math generator utilities #2542

@sampsyo

Description

@sampsyo

The calyx-py library contains not only the general machinery for generating Calyx programs but also several specific math-ish unit generators: gen_exp, gen_ln, and gen_msb.

Having all this together is not only weird from first principles, it also causes one real problem: the library's source-location tracking does some funky stuff with stack traces. In particular, it ignores stack frames that come from the calyx-py library itself:

if not frame.filename.startswith(library_path):
user = frame
break

This has the weird effect that these gen_* scripts are sometimes considered part of the library and sometimes not (e.g., when they are invoked on the command line).

Let's separate this stuff out into a standalone Python package—maybe something like frontends/gen_math or whatever. One wrinkle will be updating all the dependencies that use these generators: principally, the TVM/Relay frontend.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: calyx-pyItems that have to do with the builder libraryPriority: LowDon't do these during a deadlineS: AvailableCan be worked upongood first issueGood issue to start contributing on Calyx

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions