Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
jaxDecomp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Gitlab has been updated. More info
here
.
Show more breadcrumbs
Wassim KABALAN
jaxDecomp
Commits
e508f7d1
Commit
e508f7d1
authored
1 month ago
by
Wassim Kabalan
Browse files
Options
Downloads
Patches
Plain Diff
fix
parent
92f477c9
Branches
60-remove-shardedarray
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/jaxdecomp/_src/pencil_utils.py
+27
-1
27 additions, 1 deletion
src/jaxdecomp/_src/pencil_utils.py
tests/test_fft.py
+2
-2
2 additions, 2 deletions
tests/test_fft.py
with
29 additions
and
3 deletions
src/jaxdecomp/_src/pencil_utils.py
+
27
−
1
View file @
e508f7d1
...
...
@@ -124,7 +124,8 @@ def get_transpose_order(fft_type: FftType, mesh: Optional[Mesh] = None) -> tuple
"""
if
not
jaxdecomp
.
config
.
transpose_axis_contiguous
:
return
(
0
,
1
,
2
)
else
:
if
mesh
is
None
:
match
fft_type
:
case
FftType
.
FFT
|
FftType
.
RFFT
:
return
(
1
,
2
,
0
)
...
...
@@ -133,6 +134,31 @@ def get_transpose_order(fft_type: FftType, mesh: Optional[Mesh] = None) -> tuple
case
_
:
raise
TypeError
(
"
Only complex FFTs are currently supported through pfft.
"
)
pencil_type
=
get_pencil_type_from_mesh
(
mesh
)
match
fft_type
:
case
FftType
.
FFT
:
match
pencil_type
:
case
_jaxdecomp
.
SLAB_YZ
:
return
(
1
,
2
,
0
)
case
_jaxdecomp
.
SLAB_XY
|
_jaxdecomp
.
PENCILS
:
return
(
1
,
2
,
0
)
case
_jaxdecomp
.
NO_DECOMP
:
return
(
0
,
1
,
2
)
case
_
:
raise
TypeError
(
"
Unknown pencil type
"
)
case
FftType
.
IFFT
:
match
pencil_type
:
case
_jaxdecomp
.
SLAB_YZ
:
return
(
2
,
0
,
1
)
case
_jaxdecomp
.
SLAB_XY
|
_jaxdecomp
.
PENCILS
:
return
(
2
,
0
,
1
)
case
_jaxdecomp
.
NO_DECOMP
:
return
(
0
,
1
,
2
)
case
_
:
raise
TypeError
(
"
Unknown pencil type
"
)
case
_
:
raise
TypeError
(
"
Only complex FFTs are currently supported through pfft.
"
)
def
get_lowering_args
(
fft_type
:
FftType
,
global_shape
:
GdimsType
,
mesh
:
Mesh
)
->
tuple
[
PdimsType
,
GdimsType
]:
"""
Returns the lowering arguments based on FFT type, global shape, and mesh.
...
...
This diff is collapsed.
Click to expand it.
tests/test_fft.py
+
2
−
2
View file @
e508f7d1
...
...
@@ -77,7 +77,7 @@ class TestFFTs:
transpose_back
=
[
1
,
2
,
0
]
if
not
local_transpose
:
transpose_back
=
[
0
,
1
,
2
]
el
if
jaxdecomp
.
config
.
transpose_axis_contiguous_2
:
el
se
:
transpose_back
=
[
1
,
2
,
0
]
# Check reconstructed array
...
...
@@ -127,7 +127,7 @@ class TestFFTsGrad:
transpose_back
=
[
1
,
2
,
0
]
if
not
local_transpose
:
transpose_back
=
[
0
,
1
,
2
]
el
if
jaxdecomp
.
config
.
transpose_axis_contiguous_2
:
el
se
:
transpose_back
=
[
1
,
2
,
0
]
print
(
"
*
"
*
80
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment