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

Feature/refactor compile and link fxns #1507

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

ellosel
Copy link
Contributor

@ellosel ellosel commented Jan 3, 2025

Tensile and TensileCreateLibrary both invoke the function writeSolutionsAndKernels. This function is responsible for executing the "build recipe". That is, nearly all code related to code generation, compiling, linking, and bundling is contained in writeSolutionsAndKernels. This PR is a part of a larger parallelization change to TensileLt. Its objective is to improve the composability and testability of this important function.

Outcomes:

  • Toolchains are created at the beginning of Tensile and TensileCreateLibrary, unifying structure and access to toolchain components.
  • Toolchains have composable methods for general compile and link commands.
  • processKernelSource is the code generation entry point for TensileLt. It now returns a named tuple, KernelCodeGenResult, which contains the generated file string and metadata on the code.
  • processKernelSource is no longer responsible for writing assembly files or assembling/linking them in any way.
  • KernelWriters are now only responsible for generating source code in the form of strings, no more hidden assembler invocations.

Objectives:

  • Remove getCompileArgs from KernelWriter
  • Remove _getAssembledKernelObjectFile from KernelWriter
  • Remove getLinkCodeObjectArgs from KernelWriter
  • Remove _getSingleCodeObjectFile from KernelWriter
  • Decouple the kernel writer from the link and compile commands altogether
  • Move compile and link flag setup currently in TensileInstructions.Utils to the Toolchain module
  • Remove the assemble step from KernelWriterAssembly and add it to AssemblyToolchain

@ellosel ellosel self-assigned this Jan 3, 2025
@ellosel ellosel added the noCI Disable testing on supported CI systems: math libraries CI has this feature enabled.. label Jan 3, 2025
@ellosel ellosel force-pushed the feature/refactor-compile-and-link-fxns branch from 233129d to 634b104 Compare January 3, 2025 00:59
@ellosel ellosel removed the noCI Disable testing on supported CI systems: math libraries CI has this feature enabled.. label Jan 3, 2025
@bstefanuk bstefanuk self-assigned this Jan 3, 2025
@ellosel ellosel requested a review from bstefanuk January 3, 2025 16:35
@ellosel ellosel removed their assignment Jan 3, 2025
@ellosel ellosel marked this pull request as ready for review January 3, 2025 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants