8000 [Intel GPU] allow_tf32 for oneDNN backend - XPU part by ZhiweiYan-96 · Pull Request #137570 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[Intel GPU] allow_tf32 for oneDNN backend - XPU part #137570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
7cb460c
Update
ZhiweiYan-96 Oct 9, 2024
aa6eb63
Update
ZhiweiYan-96 Oct 12, 2024
ac3000e
Update
ZhiweiYan-96 Oct 15, 2024
7c7f5bd
Update
ZhiweiYan-96 Oct 16, 2024
a7ecf30
Update
ZhiweiYan-96 Oct 17, 2024
e14a980
Update
ZhiweiYan-96 Oct 17, 2024
48d0530
Update
ZhiweiYan-96 Oct 17, 2024
d9ab777
Update
ZhiweiYan-96 Oct 21, 2024
b6e6e4e
Update
ZhiweiYan-96 Oct 26, 2024
5a6f59a
Update
ZhiweiYan-96 Oct 28, 2024
60fb9f7
Update
ZhiweiYan-96 Oct 29, 2024
3bea915
Update
ZhiweiYan-96 Nov 13, 2024
06d1680
Update
ZhiweiYan-96 Nov 13, 2024
bf3c110
Update
ZhiweiYan-96 Nov 13, 2024
8e74b7c
Update
ZhiweiYan-96 Nov 14, 2024
2e0f344
Update
ZhiweiYan-96 Nov 20, 2024
4bc77f8
Update
ZhiweiYan-96 Nov 27, 2024
2c667ac
Update
ZhiweiYan-96 Nov 27, 2024
bc921a5
Update
ZhiweiYan-96 Nov 27, 2024
f0d657e
Update
ZhiweiYan-96 Nov 28, 2024
ab586cd
Update
ZhiweiYan-96 Dec 4, 2024
b91414a
Update
ZhiweiYan-96 Dec 5, 2024
6ce003d
Update
ZhiweiYan-96 Dec 5, 2024
c159f6b
Update
ZhiweiYan-96 Dec 5, 2024
0112cb7
Update
ZhiweiYan-96 Dec 6, 2024
4a6ac2d
Update
ZhiweiYan-96 Dec 11, 2024
ea9e69b
Update
ZhiweiYan-96 Dec 12, 2024
6c87ae6
Update
ZhiweiYan-96 Dec 17, 2024
198cc01
Update
ZhiweiYan-96 Dec 18, 2024
ea08036
Update
ZhiweiYan-96 Dec 20, 2024
913e675
Update
ZhiweiYan-96 Dec 23, 2024
5c6fac3
Update
ZhiweiYan-96 Dec 25, 2024
f95ada4
Update
ZhiweiYan-96 Dec 30, 2024
096fd09
Update
ZhiweiYan-96 Jan 6, 2025
689dadf
Update
ZhiweiYan-96 Jan 7, 2025
5f7d0e7
Update
ZhiweiYan-96 Jan 9, 2025
fb2a6c4
Update
ZhiweiYan-96 Jan 20, 2025
80ea731
Update
ZhiweiYan-96 Feb 12, 2025
bbad26b
Update
guangyey Feb 15, 2025
cc3eefe
Update
ZhiweiYan-96 Feb 16, 2025
File filter

Filter by extension

Filter by extension

< 8000 details class="details-reset details-overlay toc-select js-conversations-details select-menu ml-0"> Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update
[ghstack-poisoned]
  • Loading branch information
ZhiweiYan-96 committed Nov 28, 2024
commit f0d657e1590c4b18f1fd8c2c68afef096ce3b4c2
4 changes: 2 additions & 2 deletions aten/src/ATen/Context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ void Context::setAllowTF32CuDNN(bool b) {
allow_tf32_cudnn = b;
}

bool Context::allowTF32oneDNN() const {
bool Context::allowTF32OneDNN() const {
return allow_tf32_onednn;
}

void Context::setAllowTF32oneDNN(bool b){
void Context::setAllowTF32OneDNN(bool b){
allow_tf32_onednn = b;
}

Expand Down
4 changes: 2 additions & 2 deletions aten/src/ATen/Context.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ class TORCH_API Context {
void setFloat32MatmulPrecision(const std::string& s);
bool allowTF32CuDNN() const;
void setAllowTF32CuDNN(bool);
bool allowTF32oneDNN() const;
void setAllowTF32oneDNN(bool);
bool allowTF32OneDNN() const;
void setAllowTF32OneDNN(bool);
bool allowTF32CuBLAS() const;
void setAllowTF32CuBLAS(bool);
Float32MatmulPrecision float32MatmulPrecision() const;
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/native/mkldnn/xpu/detail/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ dnnl::memory::format_tag conv_weight_fmt(

void apply_tf32_if_allowed(dnnl::primitive_attr& pattr) {
auto& ctx = at::globalContext();
bool allow_tf32 = ctx.allowTF32oneDNN();
bool allow_tf32 = ctx.allowTF32OneDNN();
if (allow_tf32) {
pattr.set_fpmath_mode(dnnl::fpmath_mode::tf32);
}
Expand Down
4 changes: 2 additions & 2 deletions torch/_C/__init__.pyi.in
Original file line number Diff line number Diff line change
Expand Up @@ -1172,8 +1172,8 @@ def _get_cudnn_deterministic() -> _bool: ... # THPModule_deterministicCuDNN
def _set_cudnn_deterministic(arg: _bool) -> None: ... # THPModule_setDeterministicCuDNN
def _get_mkldnn_deterministic() -> _bool: ... # THPModule_deterministicMkldnn
def _set_mkldnn_deterministic(arg: _bool) -> None: ... # THPModule_setDeterministicMkldnn
def _get_onednn_allow_tf32() -> _bool: ... # THPModule_allowTF32oneDNN
def _set_onednn_allow_tf32(arg: _bool) -> None: ... # THPModule_setAllowTF32oneDNN
def _get_onednn_allow_tf32() -> _bool: ... # THPModule_allowTF32OneDNN
def _set_onednn_allow_tf32(arg: _bool) -> None: ... # THPModule_setAllowTF32OneDNN
def _get_deterministic_algorithms() -> _bool: ... # THPModule_deterministicAlgorithms
def _get_deterministic_algorithms_warn_only() -> _bool: ... # THPModule_deterministicAlgorithmsWarnOnly
def _set_deterministic_algorithms(
Expand Down
12 changes: 6 additions & 6 deletions torch/csrc/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ static PyObject* THPModule_setDeterministicAlgorithms(
END_HANDLE_TH_ERRORS
}

static PyObject* THPModule_setAllowTF32oneDNN(
static PyObject* THPModule_setAllowTF32OneDNN(
PyObject* _unsued,
PyObject* arg) {
HANDLE_TH_ERRORS
Expand All @@ -930,15 +930,15 @@ static PyObject* THPModule_setAllowTF32oneDNN(
"_set_onednn_allow_tf32 expects a bool, "
"but got ",
THPUtils_typename(arg));
at::globalContext().setAllowTF32oneDNN(arg == Py_True);
at::globalContext().setAllowTF32OneDNN(arg == Py_True);
Py_RETURN_NONE;
END_HANDLE_TH_ERRORS
}

static PyObject* THPModule_allowTF32oneDNN(
static PyObject* THPModule_allowTF32OneDNN(
PyObject* _unused,
PyObject* noargs) {
if (at::globalContext().allowTF32oneDNN())
if (at::globalContext().allowTF32OneDNN())
Py_RETURN_TRUE;
else
Py_RETURN_FALSE;
Expand Down Expand Up @@ -1488,8 +1488,8 @@ static std::initializer_list<PyMethodDef> TorchMethods = {
{"_set_mkldnn_enabled", THPModule_setUserEnabledMkldnn, METH_O, nullptr},
{"_get_cudnn_allow_tf32", THPModule_allowTF32CuDNN, METH_NOARGS, nullptr},
{"_set_cudnn_allow_tf32", THPModule_setAllowTF32CuDNN, METH_O, nullptr},
{"_get_onednn_allow_tf32", THPModule_allowTF32oneDNN, METH_NOARGS, nullptr},
{"_set_onednn_allow_tf32", THPModule_setAllowTF32oneDNN, METH_O, nullptr},
{"_get_onednn_allow_tf32", THPModule_allowTF32OneDNN, METH_NOARGS, nullptr},
{"_set_onednn_allow_tf32", THPModule_setAllowTF32OneDNN, METH_O, nullptr},
{"_get_cudnn_benchmark", THPModule_benchmarkCuDNN, METH_NOARGS, nullptr},
{"_set_cudnn_benchmark", THPModule_setBenchmarkCuDNN, METH_O, nullptr},
{"_get_cudnn_deterministic",
Expand Down
Loading
0