Skip to content
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

compiler: Revamp data alignment #2296

Merged
merged 23 commits into from
Jan 30, 2024
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2c21b09
compiler: Start revamping autopadding
FabioLuporini Jan 5, 2024
c7b601e
compiler: Extirpate decrepit loop-rounding optimization
FabioLuporini Jan 8, 2024
060e0de
compiler: Remove useless runtime checks
FabioLuporini Jan 8, 2024
e2a1077
compiler: Refactor __padding_setup__
FabioLuporini Jan 8, 2024
9233a88
compiler: Add platform to DataManager
FabioLuporini Jan 8, 2024
c5c058c
arch: Add Platform.suggested_alignment
FabioLuporini Jan 8, 2024
1f84038
compiler: Rework __padding_setup__
FabioLuporini Jan 8, 2024
2c6439b
compiler: Unpick suggested_alignment
FabioLuporini Jan 9, 2024
3ba3403
misc: Logging's perf_adv -> hint
FabioLuporini Jan 10, 2024
feb1f18
api: Enable halo customization
FabioLuporini Jan 10, 2024
4e53c7a
compiler: Tweak autopadding
FabioLuporini Jan 12, 2024
7268c9c
compiler: Fix autopadding
FabioLuporini Jan 13, 2024
a812bb3
compiler: Remove useless is_compact attribute
FabioLuporini Jan 15, 2024
3cb062d
compiler: Fix linearization in presence of autopadding
FabioLuporini Jan 15, 2024
f8f1334
pep8 happiness
FabioLuporini Jan 15, 2024
cfa5027
tests: Update expected output after tweaking autopadding
FabioLuporini Jan 16, 2024
d335eb8
examples: Update expected output
FabioLuporini Jan 17, 2024
6fb992e
compiler: Use is_integer where possible
FabioLuporini Jan 17, 2024
7479238
compiler: Fix mapify_reduce
FabioLuporini Jan 17, 2024
d85d402
misc: Homogenize docstrings to use single quotes
FabioLuporini Jan 17, 2024
733d7bc
api: Improve halo setup API and docs
FabioLuporini Jan 17, 2024
3cd6127
examples: Update expected output
FabioLuporini Jan 17, 2024
e58dc53
compiler: Skip avoid_denormals upon recursive compilation
FabioLuporini Jan 25, 2024
File filter

Filter by extension

Filter by extension

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
arch: Add Platform.suggested_alignment
  • Loading branch information
FabioLuporini committed Jan 30, 2024
commit c5c058c50ecf7d47a31816b1869164b1c0f7e308
16 changes: 15 additions & 1 deletion devito/arch/archinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,11 @@ class Platform(object):
max_mem_trans_nbytes = None
"""Maximum memory transaction size in bytes."""

suggested_alignment = None
"""
The dimension along which data should be aligned for optimal performance.
"""

def __init__(self, name):
self.name = name

Expand Down Expand Up @@ -658,9 +663,13 @@ def max_mem_trans_size(self, dtype):

class Cpu64(Platform):

# The vast majority of CPUs have a 64-byte cache line
# The vast majority of CPUs have a 64-byte cache line size
max_mem_trans_nbytes = 64

# The vast majority of CPUs expect the data's contiguous dimension to be
# aligned to the cache line size
suggested_alignment = '1-stride' # AKA contiguous dimension

# The known ISAs are to be provided by the subclasses
known_isas = ()

Expand Down Expand Up @@ -808,6 +817,9 @@ class IntelDevice(Device):

max_mem_trans_nbytes = 64

#TODO
suggested_alignment = None

@property
def march(self):
return ''
Expand All @@ -816,6 +828,7 @@ def march(self):
class NvidiaDevice(Device):

max_mem_trans_nbytes = 128
suggested_alignment = 'max-stride'

@cached_property
def march(self):
Expand All @@ -830,6 +843,7 @@ def march(self):
class AmdDevice(Device):

max_mem_trans_nbytes = 256
suggested_alignment = 'max-stride'

@cached_property
def march(cls):
Expand Down