Skip to content

Commit d32df06

Browse files
authored
[BACKEND] Add isfinite backward support in aipu (#20)
1 parent 138064c commit d32df06

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.github/workflows/aipu-build-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
source ~/env_setup.sh
5353
export FLAGTREE_BACKEND=aipu
5454
cd python
55-
python3.10 -m pip install . --no-build-isolation -v
55+
MAX_JOBS=64 python3.10 -m pip install . --no-build-isolation -v
5656
5757
- name: FlagTree Test on AIPU
5858
shell: bash

third_party/aipu/backend/aipu_torch_dev.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <c10/util/ArrayRef.h>
66

77
#include <torch/csrc/Device.h>
8+
#include <torch/csrc/autograd/autograd_not_implemented_fallback.h>
89
#include <torch/csrc/jit/serialization/pickler.h>
910
#include <torch/extension.h>
1011

@@ -328,6 +329,11 @@ TORCH_LIBRARY_IMPL(aten, PrivateUse1, m) {
328329
m.impl("aten::fill_.Scalar", &fill_scalar_aipu);
329330
}
330331

332+
// Register the autograd dispatch key for operators that have no dispatches
333+
TORCH_LIBRARY_IMPL(aten, AutogradPrivateUse1, m) {
334+
m.impl("isfinite", torch::autograd::autogradNotImplementedFallback());
335+
}
336+
331337
namespace aipu {
332338

333339
bool is_available() { return context() != nullptr; }

0 commit comments

Comments
 (0)