Skip to content

Compile the AstTensor programs to CPU intead of interpreting them #124

@Mikolaj

Description

@Mikolaj

This should be doable now that the interpreter is decently compositional. In the future, something similar can be done for GPU, but CPU should be a bit easier fiddling-wise, so it's a good start.

I have a discussion with @tomsmeding about that saved to may notes. In particular, if we start permitting

escapeHatch :: (a -> b) -> (AST a -> AST b)

then compilation becomes more complex, because we'd need callbacks to Haskell (but it's not clear how to BOT escapeHatch; differentiation would probably be via a derivative provided by the user). But, as it is, we don't have anything like this. The user can have arbitrary Haskell code mixed up with horde-ad operation invocations, but the types ensure the Haskell code is eventually fully unrolled (executed, resulting in an AST trace or a Delta "tape", depending on the pipeline).

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions