Skip to content

Grid prediction - #4

Merged
adityalj merged 5 commits into
AlexBrownAMD:StreamKfrom
adityalj:grid_prediction
Jul 22, 2024
Merged

adityalj merged 5 commits into
AlexBrownAMD:StreamKfrom
adityalj:grid_prediction

Conversation

@adityalj

Copy link
Copy Markdown
Collaborator

No description provided.

@adityalj
adityalj marked this pull request as ready for review June 27, 2024 18:44
heuristicResultsArray[i].algo.fallback = fallbackCount-- > 0 ? true : false;
heuristicResultsArray[i].state = rocblaslt_status_success;
heuristicResultsArray[i].workspaceSize = solution->requiredWorkspaceSize(problem);
heuristicResultsArray[i].workspaceSize = solution->requiredWorkspaceSize(problem, nullptr);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Does this one build? Looks like the hardware parameter is a reference

Comment on lines -2620 to -2653
size_t ContractionSolution::requiredWorkspaceSize(Problem const& problem) const
size_t ContractionSolution::requiredWorkspaceSize(Problem const& problem,
Hardware const& hardware) const
{
// TODO: Pass GSU from problem and change value[2] to gsu if gsu != default value
size_t size = 0;
size_t gsu
= problem.getParams().gsu() > 0 ? problem.getParams().gsu() : sizeMapping.globalSplitU;
size_t gsuMultiplier = gsu > 1 ? gsu : 0;

size += problem.d().totalLogicalElements() * sizeMapping.workspaceSizePerElemC
* gsuMultiplier;
if(problemType.useGradient && problemType.useBias
&& problem.getParams().biasEnum() != DataType::None)
{
if(problem.biasSrc() == ContractionProblemGemm::TENSOR::A)
{
size += problem.freeSizeA(0) * sizeMapping.workspaceSizePerElemBias * gsuMultiplier;
}
else if(problem.biasSrc() == ContractionProblemGemm::TENSOR::B)
{
size += problem.freeSizeB(0) * sizeMapping.workspaceSizePerElemBias * gsuMultiplier;
}
else if(problem.biasSrc() == ContractionProblemGemm::TENSOR::D && (gsuMultiplier == 0))
{
size += problem.d().totalLogicalElements() * sizeMapping.workspaceSizePerElemBias
* gsu;
}
}

// Custom kernel synchronizer
if(gsu > 1 && sizeMapping.globalAccumulation == 3)
if(sizeMapping.streamK > 0 && sizeMapping.streamKAtomic == 0)
{
size += (int)ceil(problem.d().sizes()[0] / (float)sizeMapping.macroTile.x)
* (int)ceil(problem.d().sizes()[1] / (float)sizeMapping.macroTile.y)
* sizeMapping.waveNum * sizeof(int32_t);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Original code is going to have to stay here as well - This should be the new non-stream-k case.


virtual std::shared_ptr<MySolution> getSolutionByIndex(Hardware const& hardware, const int index) const
{
throw std::runtime_error("[getSolutionByIndex] You should not reach here.");

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Should it throw error like above function or simply return shared_ptr()

@adityalj
adityalj merged commit a100b1f into AlexBrownAMD:StreamK Jul 22, 2024
AlexBrownAMD pushed a commit that referenced this pull request Feb 13, 2025
* feat: no global working path with asserts

* fix: bad import statement

* fix: different build_tmp dir in cmake than tensile

* fix: incorrect pathing in Tensile benchmarking

* fix: string wrap paths for assert checks

* fix: ensure all paths are built

* fix: missing global parameter warning

* fix: ensure library logic path is built

* fix: client writer paths

* fix: use child path for client libraries

* remove PrintTiming from global params

* remove another assert

* restore PrintTiming

* fix: reviewer comments

* refactor: use env var for @timing decorator

* refactor: remove library print debug

* refactor: remove exit after kernel gen option

* style: remove commented code

* refactor: move common to a module

* feat: remove 'CustomKernelDirectory' global param

* fix: amd clang version global param

* fix: second pass on amd clang version

* fix: imports for bolted on ops scripts

* chore: remove safety asserts

* chore: create more separation in Common

* fix: missing line at eof

* fix: basic reviewer comments

* chore: move global dependenct funcs to GlobalParameters.py

* fix: pass global params to splitArchs

* style: don't format caps funcs

* fix: bad import

* Add TensileLogic program to verify matrix instructions (#3)

* Remove unused and static global parameters (#5)

* fix: purge library-print-debug
* feat: make build paths static
* feat: remove 'SortProblems' global param
* feat: remove 'ExpandRanges' global param
* feat: remove 'WavefrontWidth' global param
* feat: remove 'ValidateLibrary' global param
* feat: remove 'EnableHalf' and 'ClientArgs' global params
* feat: prefer profile decorator over 'Profiler' global param
* chore: remove 'LibraryPrintDebug' from build_client.yaml
* feat: remove 'MaxFileName' from global params

* Update preferred search paths (#4)

* fix: remove files updated by precommit in merge

* fix: remove log file

* Copyright update

---------

Co-authored-by: David Dixon <david.dixon@amd.com>
AlexBrownAMD pushed a commit that referenced this pull request Jul 14, 2025
TF32 origami libs with 16x16x32 and optional lsu
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.

2 participants