Skip to content

Commit

Permalink
Update on "[pytorch] Add triplet margin loss with custom distance"
Browse files Browse the repository at this point in the history
Summary: As discussed [here](#43342),
adding in a Python-only implementation of the triplet-margin loss that takes a
custom distance function.  Still discussing whether this is necessary to add to
PyTorch Core.

Test Plan: python test/run_tests.py

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D23363898](https://our.internmc.facebook.com/intern/diff/D23363898)

[ghstack-poisoned]
  • Loading branch information
ethch18 committed Sep 1, 2020
2 parents b1a40fb + 0394c5a commit 78020be
Show file tree
Hide file tree
Showing 467 changed files with 56,613 additions and 7,831 deletions.
17 changes: 10 additions & 7 deletions .circleci/cimodel/data/binary_build_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,16 @@ def get_processor_arch_name(cuda_version):
],
)),
# Skip CUDA-9.2 builds on Windows
windows=([v for v in dimensions.CUDA_VERSIONS if v != '92'], OrderedDict(
wheel=dimensions.STANDARD_PYTHON_VERSIONS,
conda=dimensions.STANDARD_PYTHON_VERSIONS,
libtorch=[
"3.7",
],
)),
windows=(
[v for v in dimensions.CUDA_VERSIONS if v not in ['92', '110']],
OrderedDict(
wheel=dimensions.STANDARD_PYTHON_VERSIONS,
conda=dimensions.STANDARD_PYTHON_VERSIONS,
libtorch=[
"3.7",
],
)
),
)

# GCC config variants:
Expand Down
1 change: 1 addition & 0 deletions .circleci/cimodel/data/dimensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"92",
"101",
"102",
"110"
]

STANDARD_PYTHON_VERSIONS = [
Expand Down
24 changes: 20 additions & 4 deletions .circleci/cimodel/data/pytorch_build_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
("xenial", [
("rocm", [
("3.5.1", [
X("3.6"),
("3.6", [
('build_only', [XImportant(True)]),
]),
]),
]),
("gcc", [
("5.4", [ # All this subtree rebases to master and then build
XImportant("3.6"),
("3.6", [
("important", [X(True)]),
("parallel_tbb", [X(True)]),
("parallel_native", [X(True)]),
]),
Expand Down Expand Up @@ -69,7 +71,11 @@
]),
]),
("gcc", [
("9", [XImportant("3.8")]),
("9", [
("3.8", [
("coverage", [XImportant(True)]),
]),
]),
]),
]),
]
Expand Down Expand Up @@ -145,7 +151,8 @@ def child_constructor(self):
"libtorch": LibTorchConfigNode,
"important": ImportantConfigNode,
"build_only": BuildOnlyConfigNode,
"cuda_gcc_override": CudaGccOverrideConfigNode
"cuda_gcc_override": CudaGccOverrideConfigNode,
"coverage": CoverageConfigNode,
}
return next_nodes[experimental_feature]

Expand Down Expand Up @@ -232,6 +239,15 @@ def child_constructor(self):
return ExperimentalFeatureConfigNode


class CoverageConfigNode(TreeConfigNode):

def init2(self, node_name):
self.props["is_coverage"] = node_name

def child_constructor(self):
return ExperimentalFeatureConfigNode


class ImportantConfigNode(TreeConfigNode):
def modify_label(self, label):
return "IMPORTANT=" + str(label)
Expand Down
6 changes: 5 additions & 1 deletion .circleci/cimodel/data/pytorch_build_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,12 @@ def instantiate_configs():
is_important = fc.find_prop("is_important") or False
parallel_backend = fc.find_prop("parallel_backend") or None
build_only = fc.find_prop("build_only") or False
if build_only and restrict_phases is None:
is_coverage = fc.find_prop("is_coverage") or False
if build_only:
restrict_phases = ["build"]
if is_coverage and restrict_phases is None:
restrict_phases = ["build", "coverage_test"]


gpu_resource = None
if cuda_version and cuda_version != "10":
Expand Down
1 change: 1 addition & 0 deletions .circleci/cimodel/data/simple/docker_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"pytorch-linux-xenial-py3.6-gcc7",
"pytorch-linux-xenial-rocm3.3-py3.6",
"pytorch-linux-xenial-rocm3.5.1-py3.6",
"pytorch-linux-bionic-rocm3.7-py3.6",
]


Expand Down
5 changes: 0 additions & 5 deletions .circleci/cimodel/data/simple/mobile_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ def gen_tree(self):
[DOCKER_REQUIREMENT_ASAN],
["build"]
),
MobileJob(
DOCKER_IMAGE_ASAN,
[DOCKER_REQUIREMENT_ASAN],
["custom", "build", "static"]
),

# Use LLVM-DEV toolchain in android-ndk-r19c docker image
MobileJob(
Expand Down

0 comments on commit 78020be

Please sign in to comment.