Skip to content

Commit

Permalink
github workflow llvm16
Browse files Browse the repository at this point in the history
  • Loading branch information
nishant-sachdeva committed Oct 30, 2023
1 parent b1ad415 commit 3b20a54
Show file tree
Hide file tree
Showing 137 changed files with 31 additions and 80,265 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "LLVM Manylinux",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "ghcr.io/iith-compilers/manylinux2014-llvm/manylinux2014-llvm:x86-llvm14"
"image": "ghcr.io/iith-compilers/manylinux2014-llvm/manylinux2014-llvm:x86-llvm16"

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-20.04

steps:
- name: Install LLVM-12.0.0
- name: Install LLVM-16.0.1
run: |
wget https://apt.llvm.org/llvm.sh
sudo bash llvm.sh 12
sudo bash llvm.sh 16
- uses: actions/checkout@v2
- name: Eigen-setup
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-20.04

steps:
- name: Install LLVM-16.0.0
- name: Install LLVM-16.0.1
run: |
wget https://apt.llvm.org/llvm.sh
sudo bash llvm.sh 16
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

build_sdist:
runs-on: ubuntu-latest
container: ghcr.io/iith-compilers/manylinux2014-llvm/manylinux2014-llvm:x86-llvm14
container: ghcr.io/iith-compilers/manylinux2014-llvm/manylinux2014-llvm:x86-llvm16
steps:
- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
env:
CIBW_SKIP: "pp* *-musllinux_*"
CIBW_ARCHS: "x86_64"
CIBW_MANYLINUX_X86_64_IMAGE: "ghcr.io/iith-compilers/manylinux2014-llvm/manylinux2014-llvm:x86-llvm14"
CIBW_MANYLINUX_X86_64_IMAGE: "ghcr.io/iith-compilers/manylinux2014-llvm/manylinux2014-llvm:x86-llvm16"
CIBW_BEFORE_ALL: "bash Manylinux2014_Compliant_Source/pkg/build.sh"
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: "pytest {project}/Manylinux2014_Compliant_Source/pkg/tests"
Expand Down
2 changes: 1 addition & 1 deletion Manylinux2014_Compliant_Source/manylinux-llvm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ RUN cmake -DCMAKE_BUILD_TYPE=Release -G Ninja -B build \
&& cmake --install build --prefix /root/destdir

WORKDIR /root/llvm
ARG LLVM_VERSION="12.0.1"
ARG LLVM_VERSION="16.0.1"
RUN wget -q "https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-project-${LLVM_VERSION}.src.tar.xz" \
&& tar -xf "llvm-project-${LLVM_VERSION}.src.tar.xz"
WORKDIR /root/llvm/llvm-project-${LLVM_VERSION}.src/build
Expand Down
4 changes: 2 additions & 2 deletions Manylinux2014_Compliant_Source/pkg/IR2Vec/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ PyObject *IR2Vec_generateEmbeddings(PyObject *self, PyObject *args) {
// Thus , need to add one more .cpp in .so
const char *mode = "\0";

string vocab_path = seed_emb_path + "/seedEmbeddingVocab-llvm14.txt";
string vocab_path = seed_emb_path + "/seedEmbeddingVocab-llvm16.txt";
// const char*
// vocab_path=(seed_emb_path+"/seedEmbeddingVocab-300-llvm14.txt").c_str(); //
// vocab_path=(seed_emb_path+"/seedEmbeddingVocab-llvm16.txt").c_str(); //
// this should be exact path till .txt . *** NOT TAKING THIS AS USER
// DEFINED/PROVIDED ARGS ***
const char *level = "\0"; // remember that ir2vec accepts a char type for this
Expand Down
2 changes: 1 addition & 1 deletion Manylinux2014_Compliant_Source/pkg/Manifest.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include ./seedEmbeddingVocab-llvm14.txt
include ./seedEmbeddingVocab-llvm16.txt
4 changes: 2 additions & 2 deletions Manylinux2014_Compliant_Source/pkg/regen-oracle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cd src/test-suite

rm -rf oracle

SEED_VERSION="llvm14"
SEED_VERSION="llvm16"
SRC_WD="PE-benchmarks"
DEST_FOLDER_LL="PE-benchmarks-llfiles-${SEED_VERSION}"
DEST_FOLDER_SYM="oracle/SYM_${SEED_VERSION}_f"
Expand All @@ -18,7 +18,7 @@ mkdir -p ${DEST_FOLDER_LL}

for d in ${SRC_WD}/*.c ${SRC_WD}/*.cpp ${SRC_WD}/*.cc; do
echo "Compiling ${d} to IR"
name=$(basename ${d}) && oname=${name%.*} && clang-14 -S -emit-llvm -Xclang -disable-O0-optnone ${d} -o ${DEST_FOLDER_LL}/${oname}.ll &
name=$(basename ${d}) && oname=${name%.*} && clang-16 -S -emit-llvm -Xclang -disable-O0-optnone ${d} -o ${DEST_FOLDER_LL}/${oname}.ll &
done
wait

Expand Down
2 changes: 1 addition & 1 deletion Manylinux2014_Compliant_Source/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ AUTHORS : SHIKHAR JAIN (IITH COMPILERS) & ANILAVA KUNDU (IITH COMPILERS)
```
- Dir "llvm" : You can get this from llvm-project/llvm/include.
- Dir "llvm-c" : You can get this from llvm-project/llvm/include.
- "seedEmbeddingVocab-llvm14.txt" . You can get this from IR2Vec Source.
- "seedEmbeddingVocab-llvm16.txt" . You can get this from IR2Vec Source.

### In future we plan to automate wheel generation by integrating needed workflows in CI/CD pipeline. These wheels then will reflect changes in either IR2Vec or in LLVM project.

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,16 @@ Please use `--help` for further details.
#### Flow-Aware Embeddings
For all functions
* `` ir2vec -fa -vocab vocabulary/seedEmbeddingVocab-llvm14.txt -o <output_file> -level <p|f> -class <class-number> <input_ll_file>``
* `` ir2vec -fa -vocab vocabulary/seedEmbeddingVocab-llvm16.txt -o <output_file> -level <p|f> -class <class-number> <input_ll_file>``

For a specific function
* `` ir2vec -fa -vocab vocabulary/seedEmbeddingVocab-llvm14.txt -o <output_file> -level f -class <class-number> -funcName=\<function-name\><input_ll_file>``
* `` ir2vec -fa -vocab vocabulary/seedEmbeddingVocab-llvm16.txt -o <output_file> -level f -class <class-number> -funcName=\<function-name\><input_ll_file>``

#### Symbolic Embeddings
For all functions
* `` ir2vec -sym -vocab vocabulary/seedEmbeddingVocab-llvm14.txt -o <output_file> -level <p|f> -class <class-number> <input_ll_file>``
* `` ir2vec -sym -vocab vocabulary/seedEmbeddingVocab-llvm16.txt -o <output_file> -level <p|f> -class <class-number> <input_ll_file>``
For a specific function
* `` ir2vec -sym -vocab vocabulary/seedEmbeddingVocab-llvm14.txt -o <output_file> -level f -class <class-number> -funcName=\<function-name\> <input_ll_file>``
* `` ir2vec -sym -vocab vocabulary/seedEmbeddingVocab-llvm16.txt -o <output_file> -level f -class <class-number> -funcName=\<function-name\> <input_ll_file>``

## Using Libraries
The libraries can be installed by passing the installation location to the `CMAKE_INSTALL_PREFIX` flag during `cmake` followed by `make install`.
Expand Down Expand Up @@ -170,7 +170,7 @@ The following example snippet shows how to query the exposed vector representati
// Creating object to generate FlowAware representation
auto ir2vec =
IR2Vec::Embeddings(<LLVM Module>, IR2Vec::IR2VecMode::FlowAware,
"./vocabulary/seedEmbeddingVocab-llvm14.txt");
"./vocabulary/seedEmbeddingVocab-llvm16.txt");

// Getting Instruction vectors corresponding to the instructions in <LLVM Module>
auto instVecMap = ir2vec.getInstVecMap();
Expand Down
4 changes: 2 additions & 2 deletions experiments/Device_Mapping/DevMap.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
],
"source": [
"raw_embeddings, fileIndexNum = readEmd_program(\n",
" \"./output/embeddings/Device_Mapping_Symbolic_llvm14.txt\"\n",
" \"./output/embeddings/Device_Mapping_Symbolic_llvm16.txt\"\n",
")\n",
"ir2vec_sym = evaluate(max_depth=10, learning_rate=0.5, n_estimators=70, seed=104)"
]
Expand Down Expand Up @@ -359,7 +359,7 @@
],
"source": [
"raw_embeddings, fileIndexNum = readEmd_program(\n",
" \"./output/embeddings/Device_Mapping_FlowAware_llvm14.txt\"\n",
" \"./output/embeddings/Device_Mapping_FlowAware_llvm16.txt\"\n",
")\n",
"ir2vec_fa = evaluate(max_depth=10, learning_rate=0.5, n_estimators=70, seed=104)"
]
Expand Down
8 changes: 4 additions & 4 deletions experiments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Device_Mapping
| |-- cgo17-nvidia.csv
|-- output
| |-- embeddings
| | |-- Device_Mapping_Symbolic_llvm14.txt
| | |-- Device_Mapping_FlowAware_llvm14.txt
| | |-- Device_Mapping_Symbolic_llvm16.txt
| | |-- Device_Mapping_FlowAware_llvm16.txt
|-- DevMap.ipynb
```
## Thread Coarsening
Expand All @@ -60,8 +60,8 @@ Thread_Coarsening
| |-- pact-2014-runtimes.csv
|-- output
| |-- embeddings
| | |-- Thread_Coarsening_Symbolic_llvm14.txt
| | |-- Thread_Coarsening_FlowAware_llvm14.txt
| | |-- Thread_Coarsening_Symbolic_llvm16.txt
| | |-- Thread_Coarsening_FlowAware_llvm16.txt
|-- ThreadCoarsening.ipynb
```
## Out_Of_Vocabulary
Expand Down
4 changes: 2 additions & 2 deletions experiments/Thread_Coarsening/ThreadCoarsening.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@
],
"source": [
"raw_embeddings, fileIndex = readEmd_program(\n",
" \"./output/embeddings/Thread_Coarsening_Symbolic_llvm14.txt\"\n",
" \"./output/embeddings/Thread_Coarsening_Symbolic_llvm16.txt\"\n",
")\n",
"ir2vec_sym = evaluate(max_depth=1, learning_rate=0.05, n_estimators=140)"
]
Expand Down Expand Up @@ -374,7 +374,7 @@
],
"source": [
"raw_embeddings, fileIndex = readEmd_program(\n",
" \"./output/embeddings/Thread_Coarsening_FlowAware_llvm14.txt\"\n",
" \"./output/embeddings/Thread_Coarsening_FlowAware_llvm16.txt\"\n",
")\n",
"ir2vec_fa = evaluate(max_depth=1, learning_rate=0.05, n_estimators=140)"
]
Expand Down
6 changes: 3 additions & 3 deletions experiments/generate_IR2Vec_embeddings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fi

BUILD=$(realpath ${BUILD})

Absolute_path_of_RepresentationFile=$(realpath ../vocabulary/seedEmbeddingVocab-llvm14.txt)
Absolute_path_of_RepresentationFile=$(realpath ../vocabulary/seedEmbeddingVocab-llvm16.txt)

TASK_DIR=$1
if [ -z "${TASK_DIR}" ]; then
Expand All @@ -45,10 +45,10 @@ fi

if [ $EncodingType = "SYM" ]; then
PASS="sym"
Trans_type="${TASK_DIR}_Symbolic_llvm14"
Trans_type="${TASK_DIR}_Symbolic_llvm16"
elif [ $EncodingType = "FA" ]; then
PASS="fa"
Trans_type="${TASK_DIR}_FlowAware_llvm14"
Trans_type="${TASK_DIR}_FlowAware_llvm16"
else
echo "Please enter SYM or FA for EncodingType"
exit
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(ir2vec VERSION 2.0.1)
set(IR2VEC_LIB "IR2Vec")
set(IR2VEC_LIB_STATIC "IR2Vec_Static")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -std=c++17")


set(LT_LLVM_INSTALL_DIR "" CACHE PATH "LLVM installation directory")
Expand Down
Loading

0 comments on commit 3b20a54

Please sign in to comment.