Code Monkey home page Code Monkey logo

Comments (5)

shabalind avatar shabalind commented on June 17, 2024

@giuseros Do you think you'd be interested in merging the efforts here to have a common OpenTuner-tunable infrastructure? Are there any other blockers apart from #93, #94, #95 that would prevent things from connecting?

from iree-llvm-sandbox.

giuseros avatar giuseros commented on June 17, 2024

Hi @shabalind ,
Thanks for the input!

I don't think #93, #94, #95 are blockers, because those are only needed for us to have an easier life when analyzing performance (assembly, intermediate IRs, etc...). OpenTuner is agnostic of how we collect performance. Basically, here:

    compile_result = self.call_program(' '.join(cmd))
    run_cmd = './exec_matmul'
    run_result = self.call_program(run_cmd, limit=0.7)
    secs, flops = parse(run_result['stderr'])
    return Result(time=1/flops)

We compile, run the and feed the result back to the framework. Compile and run can be obtained in any way, as long as we are able to "extract" flops or time from the execution to implement the feedback loop.

If you could show me how to do that with the current python harness, then I can come up with a very simply autotuner example. Then it's mostly about how to structure the folder within the repo.

Thanks,
Giuseppe

from iree-llvm-sandbox.

shabalind avatar shabalind commented on June 17, 2024

@giuseros If you look at examples/matmul/bench.py you'll see a few key things that you need to build an equivalent of your snippet.

test_harness is roughly equivalent of call_program in your example. It evaluates a concrete configuration (in the same python process) and prints the performance results to stdout. Currently the function doesn't actually return anything yet, but it's easy to modify it to return performance numbers as well (PR to add this: #120 ).

The configuraton is defined by an expert, which is a composition of a number of transformations (see experts.py). Each transformation can be parametrized by variables (see transforms.py). Variables are roughly equivalent to OpenTuner parameters: they are typed and have a clear precise domain of all possible valid values.

Harness accepts an instantiation of expert to some concrete values and runs it on a given problem definition (i.e. matmul vs conv vs reduction vs ...) + sizes + information of wheather sizes should be passed statically or dynamically.

Once harness can be invoked programmatically to obtain performance numbers it looks like it should be easy to make an equivalent of the code snippet you provided above.

from iree-llvm-sandbox.

giuseros avatar giuseros commented on June 17, 2024

Hi @shabalind ,
It really seems easy now, thanks! I will have a stab a this in the next few days and cc you in the review

Thanks,
Giuseppe

from iree-llvm-sandbox.

shabalind avatar shabalind commented on June 17, 2024

@giuseros Great! Let me know if there is anything else that blocks your progress -- I'd be happy to help to push this forward.

from iree-llvm-sandbox.

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.