mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
Use bazel build rules from fbgemm (#36339)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/36339 Test Plan: CI Differential Revision: D21004672 Pulled By: malfet fbshipit-source-id: 8ce5b436686cfb70141104aa6722c8cc13609caa
This commit is contained in:
parent
3526627f46
commit
5a7f889a11
5 changed files with 4 additions and 257 deletions
|
|
@ -1724,6 +1724,7 @@ cc_library(
|
|||
"//third_party/miniz-2.0.8:miniz",
|
||||
"@com_google_protobuf//:protobuf",
|
||||
"@eigen",
|
||||
"@fbgemm//:fbgemm_src_headers",
|
||||
"@foxi",
|
||||
"@gloo",
|
||||
"@onnx",
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ new_local_repository(
|
|||
|
||||
new_local_repository(
|
||||
name = "fbgemm",
|
||||
build_file = "//third_party:fbgemm.BUILD",
|
||||
build_file = "//third_party:fbgemm/BUILD.bazel",
|
||||
path = "third_party/fbgemm",
|
||||
)
|
||||
|
||||
|
|
@ -103,7 +103,7 @@ new_local_repository(
|
|||
|
||||
new_local_repository(
|
||||
name = "asmjit",
|
||||
build_file = "//third_party:asmjit.BUILD",
|
||||
build_file = "//third_party:fbgemm/third_party/asmjit.BUILD",
|
||||
path = "third_party/fbgemm/third_party/asmjit",
|
||||
)
|
||||
|
||||
|
|
|
|||
28
third_party/asmjit.BUILD
vendored
28
third_party/asmjit.BUILD
vendored
|
|
@ -1,28 +0,0 @@
|
|||
load("@rules_cc//cc:defs.bzl", "cc_library")
|
||||
|
||||
cc_library(
|
||||
name = "asmjit",
|
||||
srcs = glob([
|
||||
"src/asmjit/core/*.cpp",
|
||||
"src/asmjit/x86/*.cpp",
|
||||
]),
|
||||
hdrs = glob([
|
||||
"src/asmjit/x86/*.h",
|
||||
"src/asmjit/core/*.h",
|
||||
"src/asmjit/*.h",
|
||||
]),
|
||||
copts = [
|
||||
"-DASMJIT_STATIC",
|
||||
"-fno-tree-vectorize",
|
||||
"-std=c++17",
|
||||
"-fmerge-all-constants",
|
||||
"-std=gnu++11",
|
||||
"-DTH_BLAS_MKL",
|
||||
],
|
||||
includes = [
|
||||
"asmjit/",
|
||||
"src/",
|
||||
],
|
||||
linkstatic = True,
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
2
third_party/fbgemm
vendored
2
third_party/fbgemm
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit 15e343ce0cb60b0eda46f224733e8cca3bf5271e
|
||||
Subproject commit be54f479bccbddec37e1d339c324b621c1001de0
|
||||
226
third_party/fbgemm.BUILD
vendored
226
third_party/fbgemm.BUILD
vendored
|
|
@ -1,226 +0,0 @@
|
|||
load("@rules_cc//cc:defs.bzl", "cc_library")
|
||||
|
||||
cc_library(
|
||||
name = "fbgemm_src_headers",
|
||||
hdrs = [
|
||||
"src/RefImplementations.h",
|
||||
],
|
||||
include_prefix = "fbgemm",
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "fbgemm_base",
|
||||
srcs = [
|
||||
"src/EmbeddingSpMDM.cc",
|
||||
"src/EmbeddingSpMDMNBit.cc",
|
||||
"src/ExecuteKernel.cc",
|
||||
"src/ExecuteKernelU8S8.cc",
|
||||
"src/Fbgemm.cc",
|
||||
"src/FbgemmBfloat16Convert.cc",
|
||||
"src/FbgemmConv.cc",
|
||||
"src/FbgemmFP16.cc",
|
||||
"src/FbgemmFloat16Convert.cc",
|
||||
"src/FbgemmI64.cc",
|
||||
"src/FbgemmI8Spmdm.cc",
|
||||
"src/GenerateKernelU8S8S32ACC16.cc",
|
||||
"src/GenerateKernelU8S8S32ACC16Avx512.cc",
|
||||
"src/GenerateKernelU8S8S32ACC16Avx512VNNI.cc",
|
||||
"src/GenerateKernelU8S8S32ACC32.cc",
|
||||
"src/GenerateKernelU8S8S32ACC32Avx512.cc",
|
||||
"src/GenerateKernelU8S8S32ACC32Avx512VNNI.cc",
|
||||
"src/GroupwiseConvAcc32Avx2.cc",
|
||||
"src/PackAMatrix.cc",
|
||||
"src/PackAWithIm2Col.cc",
|
||||
"src/PackBMatrix.cc",
|
||||
"src/PackMatrix.cc",
|
||||
"src/PackAWithQuantRowOffset.cc",
|
||||
"src/PackAWithRowOffset.cc",
|
||||
"src/PackWeightMatrixForGConv.cc",
|
||||
"src/PackWeightsForConv.cc",
|
||||
"src/QuantUtils.cc",
|
||||
"src/RefImplementations.cc",
|
||||
"src/RowWiseSparseAdagradFused.cc",
|
||||
"src/SparseAdagrad.cc",
|
||||
"src/Utils.cc",
|
||||
# Private headers
|
||||
"src/CodeCache.h",
|
||||
"src/CodeGenHelpers.h",
|
||||
"src/ExecuteKernel.h",
|
||||
"src/ExecuteKernelGeneric.h",
|
||||
"src/ExecuteKernelU8S8.h",
|
||||
"src/FbgemmFP16Common.h",
|
||||
"src/GenerateKernel.h",
|
||||
"src/GroupwiseConv.h",
|
||||
"src/RefImplementations.h",
|
||||
"src/TransposeUtils.h",
|
||||
],
|
||||
hdrs = [
|
||||
"include/fbgemm/FbgemmConvert.h",
|
||||
"include/fbgemm/FbgemmI64.h",
|
||||
],
|
||||
includes = [
|
||||
".",
|
||||
"src",
|
||||
],
|
||||
deps = [
|
||||
":fbgemm_avx2",
|
||||
":fbgemm_avx512",
|
||||
":fbgemm_headers",
|
||||
":fbgemm_src_headers",
|
||||
"@asmjit",
|
||||
"@cpuinfo",
|
||||
],
|
||||
linkstatic = 1,
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "fbgemm_avx2_circular",
|
||||
srcs = [
|
||||
"src/FbgemmFloat16ConvertAvx2.cc",
|
||||
],
|
||||
copts = [
|
||||
"-mavx2",
|
||||
"-mf16c",
|
||||
],
|
||||
deps = [
|
||||
":fbgemm_base",
|
||||
],
|
||||
linkstatic = 1,
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "fbgemm",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
":fbgemm_base",
|
||||
":fbgemm_avx2_circular",
|
||||
],
|
||||
linkstatic = 1,
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "fbgemm_avx2",
|
||||
srcs = [
|
||||
"src/EmbeddingSpMDMAvx2.cc",
|
||||
"src/FbgemmBfloat16ConvertAvx2.cc",
|
||||
# "src/FbgemmFloat16ConvertAvx2.cc",
|
||||
"src/FbgemmI8Depthwise3DAvx2.cc",
|
||||
"src/FbgemmI8Depthwise3x3Avx2.cc",
|
||||
"src/FbgemmI8DepthwiseAvx2.cc",
|
||||
"src/FbgemmI8DepthwisePerChannelQuantAvx2.cc",
|
||||
"src/GenerateI8Depthwise.cc",
|
||||
"src/OptimizedKernelsAvx2.cc",
|
||||
"src/PackDepthwiseConvMatrixAvx2.cc",
|
||||
"src/QuantUtilsAvx2.cc",
|
||||
"src/UtilsAvx2.cc",
|
||||
# Inline Assembly sources
|
||||
"src/FbgemmFP16UKernelsAvx2.cc",
|
||||
# Private headers
|
||||
"src/CodeCache.h",
|
||||
"src/CodeGenHelpers.h",
|
||||
"src/FbgemmFP16Common.h",
|
||||
"src/FbgemmFP16UKernelsAvx2.h",
|
||||
"src/FbgemmI8Depthwise2DAvx2-inl.h",
|
||||
"src/FbgemmI8DepthwiseAvx2-inl.h",
|
||||
"src/GenerateI8Depthwise.h",
|
||||
"src/MaskAvx2.h",
|
||||
"src/OptimizedKernelsAvx2.h",
|
||||
"src/TransposeUtils.h",
|
||||
"src/TransposeUtilsAvx2.h",
|
||||
],
|
||||
copts = [
|
||||
"-m64",
|
||||
"-mavx2",
|
||||
"-mfma",
|
||||
"-mf16c",
|
||||
"-masm=intel",
|
||||
],
|
||||
deps = [
|
||||
":fbgemm_headers",
|
||||
"@asmjit",
|
||||
],
|
||||
linkstatic = 1,
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "fbgemm_avx2_headers",
|
||||
includes = [
|
||||
"src",
|
||||
],
|
||||
hdrs = [
|
||||
"src/FbgemmFP16UKernelsAvx2.h",
|
||||
"src/MaskAvx2.h",
|
||||
"src/OptimizedKernelsAvx2.h",
|
||||
],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "fbgemm_avx512",
|
||||
srcs = [
|
||||
"src/FbgemmBfloat16ConvertAvx512.cc",
|
||||
"src/FbgemmFloat16ConvertAvx512.cc",
|
||||
"src/UtilsAvx512.cc",
|
||||
# Inline Assembly sources
|
||||
"src/FbgemmFP16UKernelsAvx512.cc",
|
||||
"src/FbgemmFP16UKernelsAvx512_256.cc",
|
||||
# Private headers
|
||||
"src/FbgemmFP16UKernelsAvx512.h",
|
||||
"src/FbgemmFP16Common.h",
|
||||
"src/MaskAvx2.h",
|
||||
"src/TransposeUtils.h",
|
||||
"src/TransposeUtilsAvx2.h",
|
||||
],
|
||||
hdrs = [
|
||||
"src/FbgemmFP16UKernelsAvx512_256.h",
|
||||
],
|
||||
copts = [
|
||||
"-m64",
|
||||
"-mfma",
|
||||
"-mavx512f",
|
||||
"-mavx512bw",
|
||||
"-mavx512dq",
|
||||
"-mavx512vl",
|
||||
"-masm=intel",
|
||||
],
|
||||
deps = [
|
||||
":fbgemm_headers",
|
||||
],
|
||||
linkstatic = 1,
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "fbgemm_avx512_headers",
|
||||
includes = [
|
||||
"src",
|
||||
],
|
||||
hdrs = [
|
||||
"src/FbgemmFP16UKernelsAvx512.h",
|
||||
"src/FbgemmFP16UKernelsAvx512_256.h",
|
||||
],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "fbgemm_headers",
|
||||
hdrs = [
|
||||
"include/fbgemm/ConvUtils.h",
|
||||
"include/fbgemm/Fbgemm.h",
|
||||
"include/fbgemm/FbgemmBuild.h",
|
||||
"include/fbgemm/FbgemmConvert.h",
|
||||
"include/fbgemm/FbgemmEmbedding.h",
|
||||
"include/fbgemm/FbgemmFP16.h",
|
||||
"include/fbgemm/FbgemmI64.h",
|
||||
"include/fbgemm/FbgemmI8DepthwiseAvx2.h",
|
||||
"include/fbgemm/FbgemmI8Spmdm.h",
|
||||
"include/fbgemm/OutputProcessing-inl.h",
|
||||
"include/fbgemm/PackingTraits-inl.h",
|
||||
"include/fbgemm/QuantUtils.h",
|
||||
"include/fbgemm/QuantUtilsAvx2.h",
|
||||
"include/fbgemm/Types.h",
|
||||
"include/fbgemm/Utils.h",
|
||||
"include/fbgemm/UtilsAvx2.h",
|
||||
],
|
||||
includes = [
|
||||
"include",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
Loading…
Reference in a new issue