pub struct FlashAttentionInstaller { /* private fields */ }Expand description
The Flash Attention CK installer.
Implementations§
Source§impl FlashAttentionInstaller
impl FlashAttentionInstaller
Sourcepub fn new(config: FlashAttentionConfig) -> Self
pub fn new(config: FlashAttentionConfig) -> Self
Create a new Flash Attention installer with the given config.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create with default config.
Sourcepub fn dependencies(&self) -> &[&str]
pub fn dependencies(&self) -> &[&str]
Get the list of required dependencies.
Flash Attention CK depends on:
- PyTorch (ROCm-enabled)
- ROCm
Sourcepub fn build_git_clone_command(&self) -> ShellCommand
pub fn build_git_clone_command(&self) -> ShellCommand
Construct the git clone command for Flash Attention.
The original script clones from:
https://github.com/ROCmSoftwarePlatform/flash-attention.git
and checks out the main branch.
Sourcepub fn build_git_checkout_command(&self) -> ShellCommand
pub fn build_git_checkout_command(&self) -> ShellCommand
Construct the git checkout command.
Sourcepub fn build_cmake_command(
&self,
rocm_env: &RocmEnv,
torch_cmake_prefix: &str,
) -> ShellCommand
pub fn build_cmake_command( &self, rocm_env: &RocmEnv, torch_cmake_prefix: &str, ) -> ShellCommand
Construct the cmake configure command.
The original script configures cmake with:
- CMAKE_PREFIX_PATH: torch cmake prefix + ROCm path
- CMAKE_BUILD_TYPE=Release
- GPU_TARGETS=gfx1100 (or detected)
- CMAKE_CXX_FLAGS=“-Wno-error”
- ROCM_PATH=/opt/rocm
Working directory: <install_dir>/build
Sourcepub fn build_make_command(&self) -> ShellCommand
pub fn build_make_command(&self) -> ShellCommand
Construct the cmake –build command.
The original script uses:
cmake --build . --config Release -j $(nproc)
Working directory: <install_dir>/build
Sourcepub fn build_setup_install_command(&self) -> ShellCommand
pub fn build_setup_install_command(&self) -> ShellCommand
Construct the Python setup.py install command.
The original script runs:
python3 setup_flash_attn_amd.py install
Auto Trait Implementations§
impl Freeze for FlashAttentionInstaller
impl RefUnwindSafe for FlashAttentionInstaller
impl Send for FlashAttentionInstaller
impl Sync for FlashAttentionInstaller
impl Unpin for FlashAttentionInstaller
impl UnsafeUnpin for FlashAttentionInstaller
impl UnwindSafe for FlashAttentionInstaller
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more