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

Working towards returning KernelArgumentHolder/PolymorphicVal's from fusion execution. #3890

Draft
wants to merge 85 commits into
base: main
Choose a base branch
from

Conversation

csarofeen
Copy link
Collaborator

No description provided.

csarofeen and others added 24 commits February 11, 2025 11:45
…nelArgumentHolder::createKernelArgumentHolder in favor of a KernelArgumentHolder constructor.
…sion_cache_utils and fusion_kernel_runtime still.
…. Need to disambiguate KernelExecutor::Compile next.
@csarofeen
Copy link
Collaborator Author

!test

@csarofeen csarofeen force-pushed the polymorphic_outs_step_1 branch from e7bc2cf to 42a46c1 Compare February 17, 2025 17:23
@csarofeen
Copy link
Collaborator Author

!test

@@ -3937,7 +3937,7 @@ SchedulerType SegmentCandidateFinder::deriveSchedulerType(
"Can not find a scheduler to schedule fusion segment");
return scheduler_type;
}

// Update the constructor implementation
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Erroneous change.

@@ -81,6 +81,51 @@ class KernelExecutor : public ExecutorAbstract {
CompileParams compile_params,
SchedulerType sceduler_type = SchedulerType::None);

// Initializer list version that creates KernelArgumentHolder from tensors
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Double check these constructors are still necessary. They get cleaned up in: step 2 (#3916) so shouldn't be a big deal, but worth checking.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed one, will cleanup in followup.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually, can remove all.

@@ -22,20 +22,48 @@

namespace nvfuser {

namespace detail {
template <typename T>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Double check this is still needed and we otherwise would recurse into the constructor of KernelArgumentHolder.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@zasdfgbnm I would value a review of KernelArgumentHolder from you. I could use your advice here, please.

@@ -52,10 +52,30 @@ class SchedulerRuntimeInfo : public NonCopyable {
const std::vector<TensorView*>& all_tvs = {},
std::optional<PrimDataType> forced_index_type = std::nullopt);

SchedulerRuntimeInfo(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Double check this is still needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can be removed.

csrc/utils.cpp Outdated
@@ -100,6 +102,40 @@ int8_t getCommonDeviceCUDA(
return found_device ? index : (int8_t)0;
}

int8_t getCommonDeviceCUDA(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Check if this can be cleaned up now or if there's still calls into the c10::IValue variant.

@@ -0,0 +1,586 @@
# SPDX-FileCopyrightText: Copyright (c) 2024-present NVIDIA CORPORATION & AFFILIATES.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Remove from this branch, it's in another branch/PR.

DataType array_type =
ArrayType{std::make_shared<DataType>(DataType::Float), 2};
auto array = IrBuilder::create<Val>(array_type);
// DataType array_type =
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@zasdfgbnm this was something I couldn't figure out how to get to work with KernelArgumentHolder, could you please advise what the right push incantation is for it?

@csarofeen
Copy link
Collaborator Author

!test

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