Skip to content

Commit

Permalink
Stable SLO source
Browse files Browse the repository at this point in the history
  • Loading branch information
vmilosevic committed Sep 10, 2024
1 parent b6098c7 commit 69eb514
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 53 deletions.
3 changes: 2 additions & 1 deletion .github/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ RUN git clone https://github.com/tenstorrent/$PROJECT_NAME.git $BUILD_DIR/$PROJE

# Build the toolchain
WORKDIR $BUILD_DIR/$PROJECT_NAME
RUN cmake -B env/build env && \
RUN source env/activate && \
cmake -B env/build env && \
cmake --build env/build

# Self-test
Expand Down
95 changes: 48 additions & 47 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Build and Publish Docker Image
on:
workflow_dispatch:
workflow_call:
push:

jobs:
build:
Expand Down Expand Up @@ -83,50 +84,50 @@ jobs:
tags: |
${{ env.IRD_IMAGE_NAME}}:${{ github.sha }}
# Tag images as latest

- name: Build and push base Docker image
uses: docker/build-push-action@v6
with:
context: .github
file: .github/Dockerfile.base
push: true
build-args: |
GIT_SHA=${{ github.sha }}
tags: |
${{ env.BASE_IMAGE_NAME}}:latest
- name: Build and push base IRD Docker image
uses: docker/build-push-action@v6
with:
context: .github
file: .github/Dockerfile.ird
push: true
build-args: |
GIT_SHA=${{ github.sha }}
FROM_IMAGE=base
tags: |
${{ env.BASE_IRD_IMAGE_NAME}}:latest
- name: Build and push CI Docker image
uses: docker/build-push-action@v6
with:
context: .github
file: .github/Dockerfile.ci
push: true
build-args: |
GIT_SHA=${{ github.sha }}
tags: |
${{ env.CI_IMAGE_NAME}}:latest
- name: Build and push IRD Docker image
uses: docker/build-push-action@v6
with:
context: .github
file: .github/Dockerfile.ird
push: true
build-args: |
GIT_SHA=${{ github.sha }}
FROM_IMAGE=ci
tags: |
${{ env.IRD_IMAGE_NAME}}:latest
# # Tag images as latest

# - name: Build and push base Docker image
# uses: docker/build-push-action@v6
# with:
# context: .github
# file: .github/Dockerfile.base
# push: true
# build-args: |
# GIT_SHA=${{ github.sha }}
# tags: |
# ${{ env.BASE_IMAGE_NAME}}:latest

# - name: Build and push base IRD Docker image
# uses: docker/build-push-action@v6
# with:
# context: .github
# file: .github/Dockerfile.ird
# push: true
# build-args: |
# GIT_SHA=${{ github.sha }}
# FROM_IMAGE=base
# tags: |
# ${{ env.BASE_IRD_IMAGE_NAME}}:latest

# - name: Build and push CI Docker image
# uses: docker/build-push-action@v6
# with:
# context: .github
# file: .github/Dockerfile.ci
# push: true
# build-args: |
# GIT_SHA=${{ github.sha }}
# tags: |
# ${{ env.CI_IMAGE_NAME}}:latest

# - name: Build and push IRD Docker image
# uses: docker/build-push-action@v6
# with:
# context: .github
# file: .github/Dockerfile.ird
# push: true
# build-args: |
# GIT_SHA=${{ github.sha }}
# FROM_IMAGE=ci
# tags: |
# ${{ env.IRD_IMAGE_NAME}}:latest
9 changes: 4 additions & 5 deletions env/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ add_custom_target(python-venv ALL COMMAND TTMLIR_TOOLCHAIN=${TTMLIR_TOOLCHAIN_DI

ExternalProject_Add(
flatbuffers
PREFIX ${TTMLIR_TOOLCHAIN_DIR}
CMAKE_GENERATOR Ninja
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=Release
Expand All @@ -36,15 +35,15 @@ ExternalProject_Add(
# -DMLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON set if debug
ExternalProject_Add(
llvm-project
PREFIX ${TTMLIR_TOOLCHAIN_DIR}
# Super hacky way to install the python dependencies before the build
PATCH_COMMAND bash -c "source ${CMAKE_CURRENT_SOURCE_DIR}/activate && pip install -r ${TTMLIR_TOOLCHAIN_DIR}/src/llvm-project/mlir/python/requirements.txt"
PATCH_COMMAND bash -c "source ${CMAKE_CURRENT_SOURCE_DIR}/activate && pip install -r mlir/python/requirements.txt"
CMAKE_GENERATOR Ninja
CMAKE_ARGS
-DPython3_FIND_VIRTUALENV=ONLY
-DPython3_EXECUTABLE=${TTMLIR_TOOLCHAIN_DIR}/venv/bin/python
-DCMAKE_INSTALL_PREFIX=${TTMLIR_TOOLCHAIN_DIR}
-DLLVM_ENABLE_PROJECTS=mlir
# Projects: bolt;clang;clang-tools-extra;compiler-rt;cross-project-tests;libc;libclc;lld;lldb;mlir;openmp;polly;pstl;flang
-DLLVM_ENABLE_PROJECTS=mlir;clang;clang-tools-extra
-DLLVM_INSTALL_UTILS=ON
# Build shared libraries
# ======================
Expand Down Expand Up @@ -77,4 +76,4 @@ ExternalProject_Add(stablehlo
INSTALL_COMMAND ""
)

add_custom_target(llvm-lit ALL COMMAND cp ${TTMLIR_TOOLCHAIN_DIR}/src/llvm-project-build/bin/llvm-lit ${TTMLIR_TOOLCHAIN_DIR}/bin/llvm-lit DEPENDS llvm-project)
add_custom_target(llvm-lit ALL COMMAND cp llvm-project-prefix/src/llvm-project-build/bin/llvm-lit ${TTMLIR_TOOLCHAIN_DIR}/bin/llvm-lit DEPENDS llvm-project)

0 comments on commit 69eb514

Please sign in to comment.