aitemplate.backend.cuda

target_def

CUDA target specialization

Classes:

CUDA([template_path, ait_static_files_path, ...])

CUDA target.

FBCUDA([arch, remote_cache_bytes])

FBCUDA target.

class aitemplate.backend.cuda.target_def.CUDA(template_path='/home/runner/work/AITemplate/AITemplate/3rdparty/cutlass', ait_static_files_path='/home/runner/work/AITemplate/AITemplate/3rdparty/../static', arch='80', cuda_version=None, **kwargs)[source]

CUDA target.

Methods:

cc()

Compiler for this target.

compile_cmd([executable])

Compile command string template for this target.

dev_select_flag()

Environment variable to select the device.

get_device_compiler_options()

Returns a list of options for the device compiler.

get_host_compiler_options()

Returns a list of options for the host compiler.

get_include_directories()

Returns a list of include directories for a compiler.

select_minimal_algo(algo_names)

Select the minimal algorithm from the list of algorithms.

src_extension()

Source file extension for this target.

cc()[source]

Compiler for this target.

Raises:

NotImplementedError – Need to be implemented by subclass.

compile_cmd(executable=False)[source]

Compile command string template for this target.

Parameters:

executable (bool, optional) – Whether the command with compile an executable object by default False

Raises:

NotImplementedError – Need to be implemented by subclass.

dev_select_flag()[source]

Environment variable to select the device.

Returns:

Environment variable to select the device.

Return type:

str

get_device_compiler_options() List[str][source]

Returns a list of options for the device compiler.

Raises:

NotImplementedError – Need to be implemented by subclass.

get_host_compiler_options() List[str][source]

Returns a list of options for the host compiler.

Raises:

NotImplementedError – Need to be implemented by subclass.

get_include_directories() List[str][source]

Returns a list of include directories for a compiler.

Raises:

NotImplementedError – Need to be implemented by subclass.

select_minimal_algo(algo_names: List[str])[source]

Select the minimal algorithm from the list of algorithms.

This is used in CI to speed up the test without running actually profiling.

Parameters:

algo_names (List[str]) – All the available algorithm names for selection.

src_extension()[source]

Source file extension for this target.

Returns:

Source file extension for this target.

Return type:

str

class aitemplate.backend.cuda.target_def.FBCUDA(arch='80', remote_cache_bytes=None, **kwargs)[source]

FBCUDA target. Used in Meta internal env only.

Methods:

binary_compile_cmd()

There is no ld by default in the prod env.

cc()

Compiler for this target.

compile_options()

Options for compiling the target.

get_device_compiler_options()

Returns a list of options for the device compiler.

get_host_compiler_options()

Returns a list of options for the host compiler.

get_include_directories()

Returns a list of include directories for a compiler.

in_ci_env()

Check if the current environment is CI.

postprocess_build_dir(build_dir)

Postprocess a build directory, allows final modification of the build directory before building.

remote_logger(record)

Upload the record to Scuba table

binary_compile_cmd()[source]

There is no ld by default in the prod env. Instead, we use ld from the gvfs path.

cc()[source]

Compiler for this target.

Raises:

NotImplementedError – Need to be implemented by subclass.

compile_options()[source]

Options for compiling the target.

Return type:

str

get_device_compiler_options() List[str][source]

Returns a list of options for the device compiler.

Raises:

NotImplementedError – Need to be implemented by subclass.

get_host_compiler_options() List[str][source]

Returns a list of options for the host compiler.

Raises:

NotImplementedError – Need to be implemented by subclass.

get_include_directories() List[str][source]

Returns a list of include directories for a compiler.

Raises:

NotImplementedError – Need to be implemented by subclass.

in_ci_env() bool[source]

Check if the current environment is CI.

Returns:

Returns True if env CI_FLAG=CIRCLECI and TRICK_CI_ENV is not set (or 0).

Return type:

bool

postprocess_build_dir(build_dir: str) None[source]

Postprocess a build directory, allows final modification of the build directory before building.

classmethod remote_logger(record)[source]

Upload the record to Scuba table