GithubHelp home page GithubHelp logo

peimu / cosense Goto Github PK

View Code? Open in Web Editor NEW

This project forked from systems-nuts/cosense

1.0 0.0 0.0 7.33 MB

License: MIT License

Shell 0.24% C++ 8.08% Python 0.31% C 85.06% Nemerle 0.01% nesC 0.05% Mathematica 3.93% Makefile 0.94% CMake 0.01% Roff 1.38%

cosense's Introduction

CoSense

Cosense is a part of the Noisy&Newton Project. Please check it for more details.

The main idea of CoSense is to use sensor specifications to help compilation optimization, including value range propagation, function overload & elimination, type compression, condition simplification, and constant substitution.


Getting started

The correct way to clone this repository to get the submodules is:

	git clone --recursive [email protected]:systems-nuts/CoSense.git

To update all submodules:

	git pull --recurse-submodules
	git submodule update --remote --recursive

If you forgot to clone with --recursive and end up with empty submodule directories, you can remedy this with

	git submodule update --init

Building the Noisy compiler and debug tools depends on the libflex, Wirth-tools, and DTrace-scripts repositories. These repositories are already included as submodules:

	Libflex:		[email protected]:phillipstanleymarbell/libflex.git
	Wirth tools:		[email protected]:phillipstanleymarbell/Wirth-tools.git
	DTrace-scripts:		[email protected]:phillipstanleymarbell/DTrace-scripts.git

For linear algebra in Newton, we use the Eigen library. This is also already linked to the repository as a submodule:

	Eigen:			[email protected]:eigenteam/eigen-git-mirror.git	

The build also depends on the C protobuf compiler, sloccount, and on Graphviz.

sudo apt install libprotobuf-c-dev protobuf-c-compiler sloccount graphviz-devel

Furthermore, LLVM is a build and runtime dependency on this project. Currently, passes related to LLVM are tested with LLVM 13 versions.

Make sure llvm-config is installed for one of the above versions. In case it is named differently, e.g., llvm-config-x you will need to create a symbolic link:

cd /location/of/llvm-config-x
ln -s llvm-config-x llvm-config

Once you have the above repositories,

  1. Create a file config.local in the root of the Noisy tree and edit it to contain
	LIBFLEXPATH     = full-path-to-libflex-repository-clone
	CONFIGPATH      = full-path-to-libflex-repository-clone
	OSTYPE		= linux
	MACHTYPE	= x86_64

For example,

	LIBFLEXPATH=/home/me/Noisy-lang-compiler/submodules/libflex
	CONFIGPATH=/home/me/Noisy-lang-compiler/submodules/libflex
	OSTYPE		= linux
	MACHTYPE	= x86_64
  1. Copy config.local to the libflex directory
	$ cp config.local submodules/libflex
  1. In src/common/Makefile and src/newton/Makefile, change COMPILERVARIANT as necessary (default is gcc).

  2. Build Libflex by going to the directory you cloned for Libflex and running make. The Makefile assumes the environment variables OSTYPE and MACHTYPE are set.

	$ cd submodules/libflex
	$ make
  1. From the root of this top-level repository, build the Noisy and Newton compilers by running make. The makefile assumes the environment variables OSTYPE and MACHTYPE are set.
	$ make -j32

Experiments

Micro Benchmarks

Our micro-benchmark test cases are listed in applications/newton/llvm-ir.

  1. Following the LLVM Benchmarking tips. We summarize it in a bash file.
sudo bash ./env.sh

In this bash file, we'll set the necessary benchmarking configs and then run the whole micro-benchmarks to check the compilation and execution. To reset the configs, run

sudo bash ./reset.sh
  1. We have an auto_test.cpp to run and log the micro-benchmarks. To compile the test file and run:
make auto_test_compile
./auto_test 2> err.log

Users can get the average performance in average_speedup.log and the detailed performance numbers in perf.log. For the compilation log, please check compile.log, and please check err.log if any error happens.

  1. Optional. We provide Python scripts to plot the figures as shown in our paper.
    • plot_sensor_ranges.py: Plot the heatmaps.
    • bar_plot.py: Plot the average speedup bar figure.

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.