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: Misc code generation improvements #2282

Merged
merged 48 commits into from
Dec 21, 2023
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
bbe3f5d
api: Accept language=sycl (still no-op though)
FabioLuporini Aug 1, 2023
a0af11f
arch: Tweak OneapiCompiler for SYCL
FabioLuporini Aug 1, 2023
96f145d
compiler: Separate out common code in PragmaShmTransformer
FabioLuporini Aug 4, 2023
465fd99
compiler: Add Lambda handler to Uxreplace
FabioLuporini Aug 7, 2023
5e9e8a2
compiler: Fix Definition.expr_symbols
FabioLuporini Aug 8, 2023
89c8514
compiler: Improve Call-Lambda interaction
FabioLuporini Aug 8, 2023
48368e5
compiler: Patch LocalObject.free_symbols
FabioLuporini Aug 8, 2023
7664589
compiler: Patch Definition.functions
FabioLuporini Aug 8, 2023
ecaa2aa
compiler: Fix Call.defines
FabioLuporini Aug 8, 2023
b073fb0
compiler: Add Lambda.{functions,defines}
FabioLuporini Aug 8, 2023
bfd961b
compiler: Support namespaces in the generated code
FabioLuporini Aug 8, 2023
5113b3d
arch: Introduce SyclCompiler
FabioLuporini Nov 22, 2023
1ef8f70
compiler: Fix FindSections for Lambda
FabioLuporini Nov 23, 2023
6b0c1c5
misc: Add docker images for sycl backend
FabioLuporini Nov 23, 2023
be4b1bf
compiler: Add ListMajor
FabioLuporini Nov 24, 2023
e7bf2a1
compiler: Enhance Lambda support
FabioLuporini Nov 24, 2023
6cbdbe9
compiler: Enhance C++ codegen capabilities
FabioLuporini Nov 27, 2023
3bc43ae
compiler: Pump C++ codegen capabilities
FabioLuporini Nov 27, 2023
5842722
compiler: Fix LocalObject codegen
FabioLuporini Nov 29, 2023
b31976c
arch: Fix OneapiCompiler MPI commands
FabioLuporini Nov 29, 2023
efafe51
compiler: Patch CGen._gen_struct_decl to swallow CustomTypes
FabioLuporini Nov 29, 2023
00f8693
compiler: Distinguish between standalones and objs
FabioLuporini Nov 30, 2023
d322cdc
compiler: Fix LocalObject codegen
FabioLuporini Nov 30, 2023
025bac4
compiler: Add LocalObject.modifier
FabioLuporini Nov 30, 2023
c4e1d24
compiler: Improve support for Call via FieldFrom* objs
FabioLuporini Nov 30, 2023
34b16cb
compiler: Allocate Weights array on the stack by default
FabioLuporini Dec 1, 2023
dd349ab
compiler: Optimize weights coefficients at startup
FabioLuporini Dec 1, 2023
7546ac0
arch: Fix OneapiCompiler.MPICC
FabioLuporini Dec 4, 2023
2037fb4
arch: Improve SyclCompiler
FabioLuporini Dec 6, 2023
05bd196
compiler: Patch IntDiv construction
FabioLuporini Dec 6, 2023
5d7d0df
compiler: Add Call.templates
FabioLuporini Dec 7, 2023
ff7e480
compiler: Patch Lambda visitors
FabioLuporini Dec 11, 2023
568cf3e
arch: Set I_MPI_OFFLOAD w/ Intel MPI on GPUs
FabioLuporini Dec 11, 2023
e748bc0
compiler: Fix factorization involving Objects
FabioLuporini Dec 11, 2023
ac7c854
compiler: Enhance LocalObject
FabioLuporini Dec 12, 2023
35f78b7
compiler: Generalize _alloc_mapped_array_on_high_bw_mem
FabioLuporini Dec 13, 2023
0e12b6f
compiler: Tweak orchestration
FabioLuporini Dec 13, 2023
4988492
misc: Rename sycl docker images
FabioLuporini Dec 15, 2023
a72f64a
compiler: Refactor Rvalue
FabioLuporini Dec 15, 2023
b4102d9
arch: Fix OneapiCompiler and SyclCompiler initialization
FabioLuporini Dec 18, 2023
9930c4e
arch: Add INTELGPUMAX
FabioLuporini Dec 19, 2023
e7d5d34
arch: Fix CustomCompiler via Intel toolchain
FabioLuporini Dec 19, 2023
632319c
compiler: Remove unnecessary code
FabioLuporini Dec 19, 2023
762ea3d
misc: Fix docstring
FabioLuporini Dec 19, 2023
796b05f
tests: Use kwargs to make API explicit
FabioLuporini Dec 19, 2023
b815b03
misc: Split Dockerfile.cpu into .cpu and .intel
FabioLuporini Dec 19, 2023
dfd7968
misc: Fix pep8
FabioLuporini Dec 19, 2023
5f63560
docker: update oneapi base drivers
mloubout Dec 20, 2023
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: Fix OneapiCompiler and SyclCompiler initialization
  • Loading branch information
FabioLuporini committed Dec 20, 2023
commit b4102d9e9f3d8aa6e7bafc49673aed8599e96a60
20 changes: 12 additions & 8 deletions devito/arch/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ def __init_finalize__(self, **kwargs):

if kwargs.get('mpi'):
self.__init_intel_mpi__()
self.cflags.insert(0, '-cc=%s' % self.CC)
self.__init_intel_mpi_flags__()

def __init_intel_mpi__(self, **kwargs):
# Make sure the MPI compiler uses an Intel compiler underneath,
Expand All @@ -747,6 +747,9 @@ def __init_intel_mpi__(self, **kwargs):
warning("Expected Intel MPI distribution with `%s`, but found `%s`"
% (self.__class__.__name__, mpi_distro))

def __init_intel_mpi_flags__(self, **kwargs):
self.cflags.insert(0, '-cc=%s' % self.CC)

def get_version(self):
if configuration['mpi']:
cmd = (self.cc, "-cc=%s" % self.CC, "--version")
Expand Down Expand Up @@ -779,7 +782,7 @@ def __lookup_cmds__(self):
class IntelKNLCompiler(IntelCompiler):

def __init_finalize__(self, **kwargs):
IntelCompiler.__init_finalize__(self, **kwargs)
super().__init_finalize__(**kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No this needs to be IntelCompiler.__init_finalize__(self, **kwargs) or it breaks CustomCompiler

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK


language = kwargs.pop('language', configuration['language'])

Expand All @@ -792,6 +795,8 @@ def __init_finalize__(self, **kwargs):
class OneapiCompiler(IntelCompiler):

def __init_finalize__(self, **kwargs):
super().__init_finalize__(**kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, same

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK


platform = kwargs.pop('platform', configuration['platform'])
language = kwargs.pop('language', configuration['language'])

Expand All @@ -817,9 +822,6 @@ def __init_finalize__(self, **kwargs):
self.cflags.append('-gline-tables-only')
self.cflags.append('-fdebug-info-for-profiling')

if kwargs.get('mpi'):
self.__init_intel_mpi__()

def __init_intel_mpi__(self, **kwargs):
super().__init_intel_mpi__(**kwargs)

Expand All @@ -830,6 +832,9 @@ def __init_intel_mpi__(self, **kwargs):
if isinstance(platform, IntelDevice):
environ['I_MPI_OFFLOAD'] = '1'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no compiler flag for it? Seems "dangerous" to change environ like that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately no compiler flag...

it is "dangerous" but devito would break anyway without this env var. It's what enables device pointer support in MPI calls ("GPU-aware MPI"), which is what we rely on (only sane choice today)


def __init_intel_mpi_flags__(self, **kwargs):
pass

get_version = Compiler.get_version

def __lookup_cmds__(self):
Expand All @@ -846,6 +851,8 @@ class SyclCompiler(OneapiCompiler):
_cpp = True

def __init_finalize__(self, **kwargs):
IntelCompiler.__init_finalize__(self, **kwargs)

platform = kwargs.pop('platform', configuration['platform'])
language = kwargs.pop('language', configuration['language'])

Expand All @@ -868,9 +875,6 @@ def __init_finalize__(self, **kwargs):
else:
raise NotImplementedError("Unsupported platform %s" % platform)

if kwargs.get('mpi'):
self.__init_intel_mpi__()


class CustomCompiler(Compiler):

Expand Down