Skip to content

Commit

Permalink
Disable embedding_ops training dependency using new buck mode (pytorc…
Browse files Browse the repository at this point in the history
…h#2221)

Summary:
Pull Request resolved: pytorch#2221

We need a new buck mode for fbgemm to specify fbgemm inference mode and then include dependency based on this and not include training related dependcies.

To enable fbgemm inference *only* mode, we can pass this in buck command line:
   -c fbcode.fbgemm_inference_mode=True

Reviewed By: sryap, jianyuh

Differential Revision: D52231398

fbshipit-source-id: 6bd27718aadf0d8a52320fea85e07755f73da9de
  • Loading branch information
banitag1 authored and facebook-github-bot committed Dec 20, 2023
1 parent 5ad728c commit 74808cd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def get_fbgemm_public_headers():
"include/fbgemm/Types.h",
]

# buildifier: disable=unused-variable
def get_fbgemm_avx2_srcs(msvc = False):
return [
#All the source files that either use avx2 instructions statically
Expand Down Expand Up @@ -109,6 +110,7 @@ def get_fbgemm_inline_avx2_srcs(msvc = False, buck = False):
})
return asm_srcs if not msvc else intrinsics_srcs

# buildifier: disable=unused-variable
def get_fbgemm_avx512_srcs(msvc = False):
return [
#All the source files that use avx512 instructions statically
Expand Down Expand Up @@ -140,3 +142,6 @@ def get_fbgemm_inline_avx512_srcs(msvc = False, buck = False):

def get_fbgemm_tests(skip_tests = []):
return native.glob(["test/*Test.cc"], exclude = skip_tests)

def get_fbgemm_inference_mode():
return native.read_config("fbcode", "fbgemm_inference_mode", False)

0 comments on commit 74808cd

Please sign in to comment.