Git Product home page Git Product logo

hpac / linnea Goto Github PK

View Code? Open in Web Editor NEW
65.0 6.0 5.0 1.64 MB

Linnea is an experimental tool for the automatic generation of optimized code for linear algebra problems.

Home Page: https://linnea.cs.umu.se

License: GNU General Public License v3.0

Python 98.32% Shell 0.96% CMake 0.01% C++ 0.40% Julia 0.19% MATLAB 0.12%
linnea linear-algebra python code-generation compiler julia high-performance-computing blas lapack

linnea's People

Contributors

chrispsa avatar dc-mak avatar hbarthels avatar julihoh avatar mcopik avatar wheerd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

linnea's Issues

OSError (File Not Found)

graph.write_output(code=True,

I get the following error when I call graph.write_output with experiment_code=True.

  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1465, in _get
    return self.loader.get_data(path)
OSError: [Errno 0] Error: 'linnea/code_generation/experiments/templates/Cpp/CMakeLists.txt'

Running example script fails

Running the example script from examples/run_linnea.py fails with the following exception:

Traceback (most recent call last):
  File "/Users/user/Code/linnea/examples/run_linnea.py", line 4, in <module>
    import linnea.config
  File "/Users/user/Code/linnea/linnea/config.py", line 247, in <module>
    load_config()
  File "/Users/user/Code/linnea/linnea/config.py", line 237, in load_config
    set_output_path(value)
  File "/Users/user/Code/linnea/linnea/config.py", line 157, in set_output_path
    raise DirectoryDoesNotExist(output_path)
linnea.config.DirectoryDoesNotExist: /Users/user/path/to/output

Note that examples/config.json sets the output path to "~/path/to/output" which might not necessarily exist. Not also however, that the output path option would be overridden in the code to be ".", but the example crashes before it comes to that.
From reading the README.md it sounds like since options from a config.json can be overridden via linnea.config.set_X that a non existing directory should not crash the example.

Generating incorrect code

I use this script to generate Julia codes. I get incorrect code (non-deterministic) for some Application examples.

Some errors:

Application 05
image

Application 16 (operand sizes from "operand_generator.jl" and the requirements in generated code does not match
image

Also it would be better if the variable id numbers in the generated code are reset every time graph.write_output is called

Change MatrixGenerator* format

Change the logic of MatrixGenerators. Strip them down of all checks/responsibilities and provide different/dedicated constructors for every matrix combination style. This will enable us to fine-tune parameters such as eigenvalues etc. based on the operand properties (Triangular, SPD etc.).

Use Linnea frontend to emit IR

Dear All,
I would be interested in using the Linnea frontend to parse a specific expression and emit intermediate representation (compiler IR). Can I use the class Equation to do that? (

class Equations():
) I miss some information regarding the type of the expression (i.e., mul or add) as well as the type of its operand. But I may be wrong. Did I miss something?
Thanks a lot

Why Python rather than Julia?

Hi there,

First of all, great tool!

Out of curiosity, given that Linnea produces Julia code eventually, why isn't it also implemented in Julia (rather than Python)? Any particular considerations?

Best,
Carsten

Generating different sets of algorithms when I toggle k_best arg

For the random expression the in script below, I always find only 1 algorithm when I set k_best arg to True in graph.write_output. But when I set it to False, I always find 5 algorithms.

    import random
    import linnea.config

    linnea.config.set_output_code_path(".")
    linnea.config.init()

    from linnea.derivation.graph.derivation import DerivationGraph
    from linnea.examples.random_expressions import generate_equation

    random.seed(0)
    rand_exprs = [generate_equation(random.randint(4, 7)) for _ in range(100)]
    equations = rand_exprs[33]

    graph = DerivationGraph(equations)
    graph.derivation(time_limit=60,
                     merging=True,
                     dead_ends=True,
                     pruning_factor=1.5)

    graph.write_output(code=True,
                       derivation=False,
                       output_name="tmp",
                       k_best=True,
                       experiment_code=False,
                       algorithms_limit=100,
                       graph=False)

Dimension mismatch

I'm getting dimension mismatch for this example while executing the runner script.

        A = Matrix("A", (m, n))

        B = Matrix("B", (n, k))

        C = Matrix("C", (k, l))

        D = Matrix("D", (k, l))

        Y = Matrix("Y", (m, l))

        # Y = AB(C+ D)
        
        self.eqns = Equations(Equal(Y,Plus(Times(A,B,C),Times(A,B,D))))

Change Benchmarker* format

  • Export all individual timings from function benchmarks (Julia, Matlab, Cpp)
  • Create python scripts that process those timings and compute confidence intervals.

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.