Skip to content

Commit

Permalink
Merge branch 'flexflow:repo-refactor' into repo-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob-Chen222 authored Apr 6, 2024
2 parents 817065b + 318152a commit fe164cc
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 8 deletions.
21 changes: 21 additions & 0 deletions .proj.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
project_name = "flexflow"
testsuite_macro = "FF_TEST_SUITE"
namespace_name = "FlexFlow"
header_extension = ".h"

build_targets = [
"utils",
"op-attrs",
"kernels",
"substitutions",
"compiler",
]
test_targets = [
"utils-tests",
"substitutions-tests",
"compiler-tests",
]

[cmake_flags_extra]
FF_CUDA_ARCH = "60"
CMAKE_CUDA_ARCHITECTURES = "60"
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ set(FF_MAX_NUM_TASK_REGIONS "20" CACHE STRING
set(FF_MAX_NUM_TASK_ARGUMENTS "5" CACHE STRING
"Maximum number of arguments that can be declared in a TaskSignature")
option(FF_USE_NCCL "Run FlexFlow with NCCL" OFF)
option(FF_USE_EXTERNAL_NCCL "Enable use of NCCL pre-compiled library, if available" ON)
option(FF_USE_PREBUILT_LEGION "Enable use of Legion pre-compiled library, if available" ON)
option(FF_USE_ALL_PREBUILT_LIBRARIES "Enable use of all pre-compiled libraries, if available" OFF)
option(FF_USE_PYTHON "Enable Python" ON)
Expand All @@ -49,6 +48,14 @@ set(FF_GPU_BACKEND "cuda" CACHE STRING "Select GPU Backend ${FF_GPU_BACKENDS}")
set_property(CACHE FF_GPU_BACKEND PROPERTY STRINGS ${FF_GPU_BACKENDS})

option(FF_USE_EXTERNAL_LEGION "Use pre-installed Legion" OFF)
option(FF_USE_EXTERNAL_NCCL "Use pre-installed NCCL" OFF)
option(FF_USE_EXTERNAL_JSON "Use pre-installed nlohmann::json" OFF)
option(FF_USE_EXTERNAL_FMT "Use pre-installed fmt" OFF)
option(FF_USE_EXTERNAL_SPDLOG "Use pre-installed spdlog" OFF)
option(FF_USE_EXTERNAL_DOCTEST "Use pre-installed doctest" OFF)
option(FF_USE_EXTERNAL_RAPIDCHECK "Use pre-installed rapidcheck" OFF)
option(FF_USE_EXTERNAL_EXPECTED "Use pre-installed tl::expected" OFF)

option(FF_BUILD_RESNET "build resnet example" OFF)
option(FF_BUILD_RESNEXT "build resnext example" OFF)
option(FF_BUILD_ALEXNET "build alexnet example" OFF)
Expand Down
13 changes: 9 additions & 4 deletions cmake/expected.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
set(EXPECTED_BUILD_TESTS OFF)
set(EXPECTED_BUILD_PACKAGE OFF)

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/deps/expected)
include(aliasing)
if (FF_USE_EXTERNAL_EXPECTED)
find_package(tl-expected REQUIRED)
alias_library(expected tl::expected)
else()
set(EXPECTED_BUILD_TESTS OFF)
set(EXPECTED_BUILD_PACKAGE OFF)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/deps/expected)
endif()
26 changes: 25 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@
inputs = {
nixpkgs.url = "nixpkgs/nixos-23.11";
flake-utils.url = "github:numtide/flake-utils";

proj-repo = {
url = "github:lockshaw/proj";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};

outputs = { self, nixpkgs, flake-utils, ... }: flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
outputs = { self, nixpkgs, flake-utils, proj-repo, ... }: flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
pkgs = import nixpkgs {
inherit system;
Expand Down Expand Up @@ -54,7 +60,7 @@
devShells = rec {
ci = mkShell {
shellHook = ''
export PATH="$HOME/ff/.scripts/:$HOME/ff/.modules/proj/bin/:$PATH"
export PATH="$HOME/ff/.scripts/:$PATH"
'';

CMAKE_FLAGS = lib.strings.concatStringsSep " " [
Expand All @@ -65,6 +71,7 @@
"-DFF_USE_EXTERNAL_SPDLOG=ON"
"-DFF_USE_EXTERNAL_DOCTEST=ON"
"-DFF_USE_EXTERNAL_RAPIDCHECK=ON"
"-DFF_USE_EXTERNAL_EXPECTED=ON"
"-DFF_USE_EXTERNAL_RANGEV3=ON"
"-DFF_USE_EXTERNAL_BOOST_PREPROCESSOR=ON"
"-DFF_USE_EXTERNAL_TYPE_INDEX=ON"
Expand All @@ -88,6 +95,7 @@
cudaPackages.nccl
cudaPackages.libcublas
cudaPackages.cuda_cudart
tl-expected
])
(with self.packages.${system}; [
legion
Expand All @@ -113,6 +121,9 @@
jq
gh
])
(with proj-repo.packages.${system}; [
proj
])
(with pkgs.python3Packages; [
gitpython
ipython
Expand Down

0 comments on commit fe164cc

Please sign in to comment.