Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
d269b40
compiler build
wmdi Oct 16, 2023
f46fd11
Merge branch 'test-substitution' into test-compiler
wmdi Oct 18, 2023
af67e9e
Merge branch 'test-substitution' into test-compiler
wmdi Nov 8, 2023
c015efb
unity dp works
wmdi Nov 15, 2023
6211b84
format
wmdi Nov 15, 2023
d9f1302
Merge remote-tracking branch 'upstream/repo-refactor' into test-compiler
wmdi Jan 24, 2024
fb58a99
fmt
wmdi Jan 24, 2024
02937e1
fix
wmdi Jan 24, 2024
6402ed0
add substitutions, compiler, and their unit tests to CI
wmdi Jan 25, 2024
0c45f61
disable runtime unit test
wmdi Jan 25, 2024
95fa427
minor fix
wmdi Feb 15, 2024
1f7e2b6
(not compilable) visitable issue for OptimalCostState
wmdi Feb 18, 2024
a9a6402
fix machine mapping hash & refactor dp algorithm
wmdi Feb 27, 2024
d8bbcb8
minor fix
wmdi Feb 27, 2024
09d3152
fix variant issue
wmdi Feb 28, 2024
a150d3a
fmt
wmdi Feb 28, 2024
2eb3fdf
fix
wmdi Mar 11, 2024
7598a92
fmt
wmdi Mar 11, 2024
05c8336
fix
wmdi Mar 14, 2024
71aeddb
Merge remote-tracking branch 'upstream/repo-refactor' into test-compiler
wmdi Mar 14, 2024
9345400
add more unit tests
wmdi Mar 18, 2024
c0015df
fmt
wmdi Mar 18, 2024
6d28697
Merge remote-tracking branch 'origin/repo-refactor' into compiler
lockshaw Mar 22, 2024
102f5fb
Fix post-merge
lockshaw Mar 22, 2024
d6e10bb
Add shell hook for sapling development
lockshaw Mar 23, 2024
95fb4cc
changed from nullopt to std::nullopt
Mar 23, 2024
c091479
fix cast issue
wmdi Mar 23, 2024
57bd35f
Merge branch 'test-compiler' of github.com:wmdi/FlexFlow into test-co…
wmdi Mar 23, 2024
54c604a
Fix spdlog cmake issue
lockshaw Mar 24, 2024
a09e528
Merge remote-tracking branch 'refs/remotes/wmdi/test-compiler' into c…
lockshaw Mar 24, 2024
8b914cf
Re-remove submodules
lockshaw Mar 24, 2024
189f323
minor fix & fmt
wmdi Mar 24, 2024
d2eb505
upd tests name to match ci
wmdi Mar 24, 2024
371324a
Add TEST_SUITE declaration to make tests findable by ctest
lockshaw Mar 26, 2024
da74817
Remove unnecessary nix files, add utils test to ci
lockshaw Mar 26, 2024
0db60db
Fix utils tests name, format
lockshaw Mar 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .flake/patches/doctest-template-test.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
diff --git a/scripts/cmake/doctestAddTests.cmake b/scripts/cmake/doctestAddTests.cmake
index 3b25485..d3ba906 100644
--- a/scripts/cmake/doctestAddTests.cmake
+++ b/scripts/cmake/doctestAddTests.cmake
@@ -56,12 +56,14 @@ foreach(line ${output})
if("${line}" STREQUAL "===============================================================================" OR "${line}" MATCHES [==[^\[doctest\] ]==])
continue()
endif()
- set(test ${line})
+ set(unescaped_test ${line})
+ # use escape commas to handle properly test cases with commas inside the name
+ string(REPLACE "," "\\," escaped_test ${unescaped_test})
set(labels "")
if(${add_labels})
# get test suite that test belongs to
execute_process(
- COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" --test-case=${test} --list-test-suites
+ COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" --test-case=${escaped_test} --list-test-suites
OUTPUT_VARIABLE labeloutput
RESULT_VARIABLE labelresult
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
@@ -85,24 +87,22 @@ foreach(line ${output})

if(NOT "${junit_output_dir}" STREQUAL "")
# turn testname into a valid filename by replacing all special characters with "-"
- string(REGEX REPLACE "[/\\:\"|<>]" "-" test_filename "${test}")
+ string(REGEX REPLACE "[/\\:\"|<>]" "-" test_filename "${unescaped_test}")
set(TEST_JUNIT_OUTPUT_PARAM "--reporters=junit" "--out=${junit_output_dir}/${prefix}${test_filename}${suffix}.xml")
else()
unset(TEST_JUNIT_OUTPUT_PARAM)
endif()
- # use escape commas to handle properly test cases with commas inside the name
- string(REPLACE "," "\\," test_name ${test})
# ...and add to script
add_command(add_test
- "${prefix}${test}${suffix}"
+ "${prefix}${unescaped_test}${suffix}"
${TEST_EXECUTOR}
"${TEST_EXECUTABLE}"
- "--test-case=${test_name}"
+ "--test-case=${escaped_test}"
"${TEST_JUNIT_OUTPUT_PARAM}"
${extra_args}
)
add_command(set_tests_properties
- "${prefix}${test}${suffix}"
+ "${prefix}${unescaped_test}${suffix}"
PROPERTIES
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
${properties}
43 changes: 0 additions & 43 deletions .flake/pkgs/tokenizers-cpp.nix

This file was deleted.

9 changes: 9 additions & 0 deletions .github/workflows/helpers/build_libs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#! /usr/bin/env bash

set -euo pipefail

DIR="$(realpath -- "$(dirname "${BASH_SOURCE[0]}")")"
REPO="$(realpath -- "$DIR/../../../")"

cd "$REPO/build-ci"
make -j $(( $(nproc) < 2 ? 1 : $(nproc)-1 )) "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,21 @@ REPO="$(realpath -- "$DIR/../../../")"

export FF_GPU_BACKEND="cuda"
export FF_CUDA_ARCH=70
cd "$REPO"
mkdir build
cd build

if [[ -d "$REPO/build-ci" ]]; then
rm -rf "$REPO/build-ci"
fi
mkdir "$REPO/build-ci"
cd "$REPO/build-ci"
#if [[ "${FF_GPU_BACKEND}" == "cuda" ]]; then
# export FF_BUILD_ALL_EXAMPLES=ON
# export FF_BUILD_UNIT_TESTS=ON
#fi
IFS=" " read -r -a FLAGS <<< "$CMAKE_FLAGS"
../config/config.linux \
-DCMAKE_CXX_COMPILER="clang++" \
-DCMAKE_C_COMPILER="clang" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CUDA_COMPILER_LAUNCHER=ccache \
-DFF_USE_EXTERNAL_LEGION=ON \
-DFF_USE_EXTERNAL_JSON=ON \
-DFF_USE_EXTERNAL_FMT=ON \
-DFF_USE_EXTERNAL_SPDLOG=ON
"${FLAGS[@]}"

# vim: set tabstop=2 shiftwidth=2 expandtab:
14 changes: 14 additions & 0 deletions .github/workflows/helpers/test_libs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#! /usr/bin/env bash

set -euo pipefail
set -x

DIR="$(realpath -- "$(dirname "${BASH_SOURCE[0]}")")"
REPO="$(realpath -- "$DIR/../../../")"

TEST_LIBS=("${@/%/-tests}")
REGEX="^$(IFS='|'; echo "${TEST_LIBS[*]}")\$"

cd "$REPO/build-ci"
make -j $(( $(nproc) < 2 ? 1 : $(nproc)-1 )) "${TEST_LIBS[@]}"
ctest --progress --output-on-failure -L "$REGEX"
37 changes: 28 additions & 9 deletions .github/workflows/per-lib-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:
with:
submodules: recursive

- name: Add helpers directory to path
run: echo "${PWD}/.github/workflows/helpers" >> $GITHUB_PATH

- name: Install nix
uses: cachix/install-nix-action@v25
with:
Expand Down Expand Up @@ -51,24 +54,40 @@ jobs:

- name: Run cmake
run: |
.github/workflows/helpers/build_${{ matrix.gpu_backend }}.sh
cmake_${{ matrix.gpu_backend }}.sh

- name: Build utils
run: |
cd build
make -j $(( $(nproc) < 2 ? 1 : $(nproc)-1 )) utils
build_libs.sh utils

- name: Build op-attrs
run: |
cd build
make -j $(( $(nproc) < 2 ? 1 : $(nproc)-1 )) op-attrs
build_libs.sh op-attrs

- name: Build pcg
run: |
cd build
make -j $(( $(nproc) < 2 ? 1 : $(nproc)-1 )) pcg
build_libs.sh pcg

- name: Build kernels
run: |
cd build
make -j $(( $(nproc) < 2 ? 1 : $(nproc)-1 )) kernels
build_libs.sh kernels

- name: Build substitutions
run: |
build_libs.sh substitutions

- name: Build compiler
run: |
build_libs.sh compiler

- name: Test utils
run: |
test_libs.sh utils

- name: Test substitutions
run: |
test_libs.sh substitutions

- name: Test compiler
run: |
test_libs.sh compiler
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ include(nccl)
include(json)
include(expected)
include(spdlog)
include(doctest)
include(doctestlib) # named doctestlib to avoid a name collision with doctest.cmake in rapidcheck
include(visit_struct)
include(CTest)
include(fmt)
Expand Down
9 changes: 0 additions & 9 deletions cmake/doctest.cmake

This file was deleted.

11 changes: 11 additions & 0 deletions cmake/doctestlib.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include(aliasing)

if (FF_USE_EXTERNAL_DOCTEST)
find_package(doctest REQUIRED)
include(doctest) # import doctest_discover_tests
else()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/deps/doctest)
include(${CMAKE_CURRENT_SOURCE_DIR}/deps/doctest/scripts/cmake/doctest.cmake)
endif()

alias_library(doctest doctest::doctest)
4 changes: 3 additions & 1 deletion cmake/flexflow-utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ function(ff_add_test_executable)
${FF_TEST_EXEC_NAME}
${FF_TEST_EXEC_DEPS})

target_compile_definitions(${FF_TEST_EXEC_NAME} PRIVATE FF_TEST_SUITE="${FF_TEST_EXEC_NAME}")

define_ff_vars(${FF_TEST_EXEC_NAME})
ff_set_cxx_properties(${FF_TEST_EXEC_NAME})
doctest_discover_tests(${FF_TEST_EXEC_NAME})
doctest_discover_tests(${FF_TEST_EXEC_NAME} ADD_LABELS 1)
endfunction()
3 changes: 1 addition & 2 deletions cmake/fmt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ if (FF_USE_EXTERNAL_FMT)
find_package(fmt REQUIRED)
else()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/deps/fmt)

alias_library(fmt fmt::fmt)
endif()
alias_library(fmt fmt::fmt)
1 change: 1 addition & 0 deletions cmake/nccl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ else()
message(STATUS "Building NCCL from source")
list(TRANSFORM CUDA_GENCODE PREPEND "NVCC_GENCODE=" OUTPUT_VARIABLE NCCL_BUILD_NVCC_GENCODE)

include(ExternalProject)
ExternalProject_Add(nccl_source_build
SOURCE_DIR ${PROJECT_SOURCE_DIR}/deps/${NCCL_NAME}
PREFIX ${CMAKE_BINARY_DIR}/deps/${NCCL_NAME}
Expand Down
6 changes: 5 additions & 1 deletion cmake/rapidcheck.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/deps/rapidcheck)
if (FF_USE_EXTERNAL_RAPIDCHECK)
find_package(rapidcheck REQUIRED)
else()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/deps/rapidcheck)
endif()
7 changes: 5 additions & 2 deletions cmake/spdlog.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ if (FF_USE_EXTERNAL_SPDLOG)
find_package(spdlog REQUIRED)
else()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/deps/spdlog)

alias_library(spdlog spdlog::spdlog)
endif()

add_library(ff_spdlog INTERFACE)
target_link_libraries(ff_spdlog INTERFACE spdlog::spdlog)
target_compile_definitions(ff_spdlog INTERFACE SPDLOG_FMT_EXTERNAL)
alias_library(spdlog ff_spdlog)
Loading