Repository navigation
Remove unused and static global parameters #5
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
Changes from 22 commits
916649c
c8eaec3
73d9777
8fb2aa4
353c1f9
aa37e27
83c1579
cfd24ef
e1ccd66
16a90ac
3e15ca0
8055876
8b494b0
4034d5c
96378bd
a990ad8
714b9a4
e16bd5b
aada843
8b47b35
b0e44be
e403138
855a7c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,7 +34,8 @@ | |
| from . import ROOT_PATH | ||
| from . import ClientExecutable | ||
| from . import LibraryIO | ||
| from .Common import globalParameters, ensurePath, print1, printExit, printWarning, ClientExecutionLock, isaToGfx | ||
| from .Common import globalParameters, ensurePath, print1, printExit, printWarning, ClientExecutionLock, isaToGfx, \ | ||
| LIBRARY_LOGIC_DIR, LIBRARY_CLIENT_DIR | ||
| from .SolutionStructs import ProblemType, ProblemSizesMock, ProblemSizesMockDummy, ActivationArgs, BiasTypeArgs, FactorDimArgs | ||
| from .TensileCreateLibrary import copyStaticFiles | ||
| from .Contractions import FreeIndex, BatchIndex | ||
|
|
@@ -80,8 +81,8 @@ class ClientLogLevel(Enum): | |
| ################################################################################ | ||
| def main(config, cxxCompiler: str, cCompiler: str, outputPath: Path): | ||
|
|
||
| libraryLogicPath = ensurePath(outputPath / globalParameters["LibraryLogicPath"]) | ||
| clientLibraryPath = ensurePath(outputPath / globalParameters["LibraryClientPath"]) | ||
| libraryLogicPath = ensurePath(outputPath / LIBRARY_LOGIC_DIR) | ||
| clientLibraryPath = ensurePath(outputPath / LIBRARY_CLIENT_DIR) | ||
| sourcePath = ensurePath(clientLibraryPath / "source") | ||
| copyStaticFiles(sourcePath) | ||
|
|
||
|
|
@@ -95,7 +96,6 @@ def main(config, cxxCompiler: str, cCompiler: str, outputPath: Path): | |
| print1("LogicFiles: %s" % logicFiles) | ||
| functions = [] | ||
| functionNames = [] | ||
| enableHalf = False | ||
|
|
||
| createLibraryScript = getBuildClientLibraryScript(clientLibraryPath, libraryLogicPath, cxxCompiler) | ||
| subprocess.run(shlex.split(createLibraryScript), cwd=clientLibraryPath) | ||
|
|
@@ -106,8 +106,6 @@ def main(config, cxxCompiler: str, cCompiler: str, outputPath: Path): | |
| for logicFileName in logicFiles: | ||
| (scheduleName, _, problemType, _, exactLogic, newLibrary) \ | ||
| = LibraryIO.parseLibraryLogicFile(logicFileName, cxxCompiler) | ||
| if problemType["DataType"].isHalf(): | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What was this replaced with?
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only ever set not ever used. |
||
| enableHalf = True | ||
| functions.append((scheduleName, problemType)) | ||
| functionNames.append("tensile_%s" % (problemType)) | ||
| problemSizes = ProblemSizesMock(exactLogic) if exactLogic else ProblemSizesMockDummy() | ||
|
|
@@ -154,7 +152,6 @@ def main(config, cxxCompiler: str, cCompiler: str, outputPath: Path): | |
| codeObjectFiles=coList, | ||
| tileAwareSelection=False, | ||
| libraryFile=yamlList[0])) | ||
| globalParameters["EnableHalf"] = enableHalf | ||
|
|
||
| forBenchmark = False | ||
| problemSizes = None | ||
|
|
@@ -286,7 +283,7 @@ def writeRunScript(path, forBenchmark, enableTileSelection, cxxCompiler: str, cC | |
|
|
||
| clientExe = ClientExecutable.getClientExecutable(cxxCompiler, cCompiler, buildDir) | ||
| for configFile in configPaths: | ||
| runScriptFile.write("{} --config-file {} {}\n".format(clientExe, configFile, globalParameters["ClientArgs"])) | ||
| runScriptFile.write("{} --config-file {}\n".format(clientExe, configFile)) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How can we remove args here?
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ClientArgs is only ever an empty string |
||
| runScriptFile.write("ERR2=$?\n\n") | ||
|
|
||
| runScriptFile.write(""" | ||
|
|
@@ -309,7 +306,7 @@ def writeRunScript(path, forBenchmark, enableTileSelection, cxxCompiler: str, cC | |
| runScriptFile.write("%s -d 0 --setfan 50\n" % globalParameters["ROCmSMIPath"]) | ||
| else: | ||
| for configFile in configPaths: | ||
| runScriptFile.write("{} --config-file {} {} --best-solution 1\n".format(ClientExecutable.getClientExecutable(cxxCompiler, cCompiler, buildDir), configFile, globalParameters["ClientArgs"])) | ||
| runScriptFile.write("{} --config-file {} --best-solution 1\n".format(ClientExecutable.getClientExecutable(cxxCompiler, cCompiler, buildDir), configFile)) | ||
| if os.name != "nt": | ||
| runScriptFile.write("exit $ERR\n") | ||
| runScriptFile.close() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,7 +24,8 @@ | |
|
|
||
| from pathlib import Path | ||
| from .Common import print1, print2, HR, printExit, defaultAnalysisParameters, globalParameters, \ | ||
| assignParameterWithDefault, startTime, ProgressBar, printWarning, ensurePath | ||
| assignParameterWithDefault, startTime, ProgressBar, printWarning, ensurePath, \ | ||
| LIBRARY_LOGIC_DIR, BENCHMARK_DATA_DIR | ||
| from .SolutionStructs import Solution | ||
| from . import LibraryIO | ||
| from . import SolutionSelectionLibrary | ||
|
|
@@ -317,30 +318,9 @@ def __init__(self, problemType, problemSizesList, solutionsList, \ | |
| #FIXME-problem | ||
| self.rangeProblemSizes.update([tuple(problem.sizes) for problem in problemSizes.problems]) | ||
| for rangeSize in problemSizes.ranges: | ||
|
|
||
| if globalParameters["ExpandRanges"]: | ||
| # Treat ranges as pile of exacts: | ||
| for rsize in rangeSize.problemSizes: | ||
| self.exactProblemSizes.add(tuple(rsize)) | ||
| else: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We never take the else branch?
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope, never, "ExpandRanges" is only ever set to True, and isn't overridden in any logic files. |
||
| # Create the ranges info in the logic file | ||
| #print "RangeSize", rangeSize | ||
| sizedIdx = 0 | ||
| mappedIdx = 0 | ||
| for i in range(0, self.numIndices): | ||
| if rangeSize.indexIsSized[i]: | ||
| index = rangeSize.indicesSized[sizedIdx] | ||
| sizedIdx += 1 | ||
| else: | ||
| index = rangeSize.indicesSized[ \ | ||
| rangeSize.indicesMapped[mappedIdx]] | ||
| mappedIdx += 1 | ||
| currentSize = index[0] | ||
| currentStride = index[1] | ||
| while currentSize <= index[3]: | ||
| unifiedProblemSizes[i].add(currentSize) | ||
| currentSize += currentStride | ||
| currentStride += index[2] | ||
| # Treat ranges as pile of exacts: | ||
| for rsize in rangeSize.problemSizes: | ||
| self.exactProblemSizes.add(tuple(rsize)) | ||
| for i in range(0, len(unifiedProblemSizes)): | ||
| unifiedProblemSizes[i] = sorted(list(unifiedProblemSizes[i])) | ||
| print2("UnifiedProblemSizes: %s" % unifiedProblemSizes) | ||
|
|
@@ -1567,6 +1547,6 @@ def read_max_freq(): | |
| ################################################################################ | ||
| ################################################################################ | ||
| def main(config, cxxCompiler: str, outputPath: Path): | ||
| benchmarkDataPath = outputPath / globalParameters["BenchmarkDataPath"] | ||
| libraryLogicPath = outputPath / globalParameters["LibraryLogicPath"] | ||
| benchmarkDataPath = outputPath / BENCHMARK_DATA_DIR | ||
| libraryLogicPath = outputPath / LIBRARY_LOGIC_DIR | ||
| generateLogic(config, benchmarkDataPath, libraryLogicPath, cxxCompiler) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume removing globalParams isn't in scope.