Coder Social home page Coder Social logo

flupe / hash-modulo-alpha Goto Github PK

View Code? Open in Web Editor NEW

This project forked from microsoft/hash-modulo-alpha

0.0 0.0 0.0 313 KB

Quickly hashing all subexpressions of a program modulo alpha-renaming

License: MIT License

Python 10.57% Haskell 89.43%

hash-modulo-alpha's Introduction

Hashing Modulo Alpha-Equivalence

This repository contains supporting code for the "Hashing Modulo Alpha-Equivalence" paper.

Dependencies

You need a reasonably modern installation of GHC and cabal on your PATH. If you don't already have one you might like to follow the instructions for installing the Haskell Platform.

Additionally, to generate plots from the raw output data, you will either need gnuplot or Python 3.6.

Building

In the top level of the repository run

cabal v2-update
cabal v2-install --ghc-options="-Wwarn" --installdir=. --overwrite-policy=always --install-method=copy

Running

Most commands have two variants:

  • full, which was unsed to produce all the plots and measurements in the paper, and
  • fast, which is faster, but gives results that are either more noisy, less accurate, or smaller scale

Checking that everything works

  • Run the tests

    ./hash test

  • Run a very quick benchmark

    ./hash random fast

Running the full benchmarks

  • Run the full benchmarks on random expressions

    ./hash random full +RTS -I0 -A90G -G1 -m1 -RTS

    (The RTS options configure the garbage collector to run less)

  • Run the full benchmarks on real-life expressions

    ./hash manual full

  • Run the full analysis of hash collisions

    ./hash collisions full

Repository structure

  • exe/ defines the entry point to the code.
  • src/ contains several variants of our hashing algorithm.
    • While only the final AlphaHashOptimizedHash.hs is being benchmarked, we also release AlphaHashInefficient.hs, AlphaHashEfficient.hs and AlphaHashEfficientHash.hs, which are stepping stones that match the flow of the paper.
    • AlphaHashOptimizedHash16Bit.hs is a 16-bit version of our algorithm, used only for benchmarking the empirical frequency of hash collisions.
  • exprs/ contains real-life expressions extracted from complex machine learning models such as BERT.

Authors

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

hash-modulo-alpha's People

Contributors

awf avatar kmaziarz avatar tomjaguarpaw avatar

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.