nvfuser-cu121-torch25 0.2.25.dev20250201__cp312-cp312-manylinux_2_28_x86_64.whl
Sign up to get free protection for your applications and to get access to all the features.
- nvfuser/_C.cpython-312-x86_64-linux-gnu.so +0 -0
- nvfuser/__init__.py +618 -0
- nvfuser/__init__.pyi +4 -0
- nvfuser/contrib/__init__.py +9 -0
- nvfuser/contrib/nn/__init__.py +13 -0
- nvfuser/contrib/nn/normalization.py +725 -0
- nvfuser/include/nvfuser/alias_analysis.h +116 -0
- nvfuser/include/nvfuser/bfs.h +929 -0
- nvfuser/include/nvfuser/codegen.h +26 -0
- nvfuser/include/nvfuser/compute_at.h +28 -0
- nvfuser/include/nvfuser/compute_at_map.h +394 -0
- nvfuser/include/nvfuser/contiguity.h +351 -0
- nvfuser/include/nvfuser/cuda_utils.h +50 -0
- nvfuser/include/nvfuser/debug.h +50 -0
- nvfuser/include/nvfuser/device_lower/analysis/bank_conflict.h +53 -0
- nvfuser/include/nvfuser/device_lower/analysis/circular_buffer.h +109 -0
- nvfuser/include/nvfuser/device_lower/analysis/device_version.h +65 -0
- nvfuser/include/nvfuser/device_lower/analysis/divisible_split.h +28 -0
- nvfuser/include/nvfuser/device_lower/analysis/fused_reduction.h +36 -0
- nvfuser/include/nvfuser/device_lower/analysis/index_compute.h +322 -0
- nvfuser/include/nvfuser/device_lower/analysis/predicate_elimination.h +71 -0
- nvfuser/include/nvfuser/device_lower/analysis/sync_information.h +47 -0
- nvfuser/include/nvfuser/device_lower/analysis/tensor_memory.h +65 -0
- nvfuser/include/nvfuser/device_lower/analysis/thread_predicate.h +158 -0
- nvfuser/include/nvfuser/device_lower/analysis/tma.h +93 -0
- nvfuser/include/nvfuser/device_lower/analysis/trivial_broadcast.h +75 -0
- nvfuser/include/nvfuser/device_lower/id_model_options.h +135 -0
- nvfuser/include/nvfuser/device_lower/lower2device.h +391 -0
- nvfuser/include/nvfuser/device_lower/pass/alias_memory.h +37 -0
- nvfuser/include/nvfuser/device_lower/pass/allocation.h +32 -0
- nvfuser/include/nvfuser/device_lower/pass/circular_buffer.h +191 -0
- nvfuser/include/nvfuser/device_lower/pass/expr_sort.h +17 -0
- nvfuser/include/nvfuser/device_lower/pass/fusion_simplifier.h +21 -0
- nvfuser/include/nvfuser/device_lower/pass/grid_serialization.h +26 -0
- nvfuser/include/nvfuser/device_lower/pass/index.h +200 -0
- nvfuser/include/nvfuser/device_lower/pass/inline_ptx.h +16 -0
- nvfuser/include/nvfuser/device_lower/pass/insert_syncs.h +39 -0
- nvfuser/include/nvfuser/device_lower/pass/instrument.h +24 -0
- nvfuser/include/nvfuser/device_lower/pass/loop_rotation.h +150 -0
- nvfuser/include/nvfuser/device_lower/pass/loops.h +68 -0
- nvfuser/include/nvfuser/device_lower/pass/magic_zero.h +86 -0
- nvfuser/include/nvfuser/device_lower/pass/misaligned_vectorization.h +118 -0
- nvfuser/include/nvfuser/device_lower/pass/predicate.h +23 -0
- nvfuser/include/nvfuser/device_lower/pass/replace_size.h +24 -0
- nvfuser/include/nvfuser/device_lower/pass/scalar_hoist.h +115 -0
- nvfuser/include/nvfuser/device_lower/pass/unroll.h +98 -0
- nvfuser/include/nvfuser/device_lower/pass/vectorize_welford.h +45 -0
- nvfuser/include/nvfuser/device_lower/pass/warp_reduce.h +23 -0
- nvfuser/include/nvfuser/device_lower/utils.h +382 -0
- nvfuser/include/nvfuser/device_lower/validation.h +74 -0
- nvfuser/include/nvfuser/disjoint_set.h +556 -0
- nvfuser/include/nvfuser/dispatch.h +334 -0
- nvfuser/include/nvfuser/driver_api.h +49 -0
- nvfuser/include/nvfuser/dynamic_transform.h +316 -0
- nvfuser/include/nvfuser/dynamic_type/C++20/type_traits +37 -0
- nvfuser/include/nvfuser/dynamic_type/dynamic_type.h +969 -0
- nvfuser/include/nvfuser/dynamic_type/error.h +24 -0
- nvfuser/include/nvfuser/dynamic_type/type_traits.h +703 -0
- nvfuser/include/nvfuser/evaluator_common.h +295 -0
- nvfuser/include/nvfuser/exceptions.h +283 -0
- nvfuser/include/nvfuser/expr_evaluator.h +125 -0
- nvfuser/include/nvfuser/expr_simplifier.h +218 -0
- nvfuser/include/nvfuser/flatbuffers/allocator.h +68 -0
- nvfuser/include/nvfuser/flatbuffers/array.h +253 -0
- nvfuser/include/nvfuser/flatbuffers/base.h +486 -0
- nvfuser/include/nvfuser/flatbuffers/buffer.h +154 -0
- nvfuser/include/nvfuser/flatbuffers/buffer_ref.h +53 -0
- nvfuser/include/nvfuser/flatbuffers/code_generator.h +80 -0
- nvfuser/include/nvfuser/flatbuffers/code_generators.h +234 -0
- nvfuser/include/nvfuser/flatbuffers/default_allocator.h +64 -0
- nvfuser/include/nvfuser/flatbuffers/detached_buffer.h +114 -0
- nvfuser/include/nvfuser/flatbuffers/flatbuffer_builder.h +1225 -0
- nvfuser/include/nvfuser/flatbuffers/flatbuffers.h +272 -0
- nvfuser/include/nvfuser/flatbuffers/flatc.h +130 -0
- nvfuser/include/nvfuser/flatbuffers/flex_flat_util.h +36 -0
- nvfuser/include/nvfuser/flatbuffers/flexbuffers.h +1889 -0
- nvfuser/include/nvfuser/flatbuffers/grpc.h +300 -0
- nvfuser/include/nvfuser/flatbuffers/hash.h +127 -0
- nvfuser/include/nvfuser/flatbuffers/idl.h +1359 -0
- nvfuser/include/nvfuser/flatbuffers/minireflect.h +420 -0
- nvfuser/include/nvfuser/flatbuffers/reflection.h +522 -0
- nvfuser/include/nvfuser/flatbuffers/reflection_generated.h +1471 -0
- nvfuser/include/nvfuser/flatbuffers/registry.h +128 -0
- nvfuser/include/nvfuser/flatbuffers/stl_emulation.h +513 -0
- nvfuser/include/nvfuser/flatbuffers/string.h +64 -0
- nvfuser/include/nvfuser/flatbuffers/struct.h +53 -0
- nvfuser/include/nvfuser/flatbuffers/table.h +168 -0
- nvfuser/include/nvfuser/flatbuffers/util.h +731 -0
- nvfuser/include/nvfuser/flatbuffers/vector.h +393 -0
- nvfuser/include/nvfuser/flatbuffers/vector_downward.h +273 -0
- nvfuser/include/nvfuser/flatbuffers/verifier.h +317 -0
- nvfuser/include/nvfuser/fusion.h +511 -0
- nvfuser/include/nvfuser/fusion_guard.h +37 -0
- nvfuser/include/nvfuser/fusion_profiler.h +311 -0
- nvfuser/include/nvfuser/fusion_segmenter.h +751 -0
- nvfuser/include/nvfuser/global_allocator.h +27 -0
- nvfuser/include/nvfuser/grouped_reduction.h +47 -0
- nvfuser/include/nvfuser/host_ir/container.h +60 -0
- nvfuser/include/nvfuser/host_ir/executor.h +152 -0
- nvfuser/include/nvfuser/host_ir/host_ir.h +320 -0
- nvfuser/include/nvfuser/host_ir/lower.h +35 -0
- nvfuser/include/nvfuser/id_model/circular_buffer_indexing.h +56 -0
- nvfuser/include/nvfuser/id_model/contiguity.h +166 -0
- nvfuser/include/nvfuser/id_model/id_model.h +359 -0
- nvfuser/include/nvfuser/id_model/id_model_index_compute.h +81 -0
- nvfuser/include/nvfuser/id_model/indexing.h +208 -0
- nvfuser/include/nvfuser/id_model/indexing_traversal.h +72 -0
- nvfuser/include/nvfuser/id_model/indexing_utils.h +62 -0
- nvfuser/include/nvfuser/id_model/loop_promotion.h +180 -0
- nvfuser/include/nvfuser/id_model/predicate_indexing.h +104 -0
- nvfuser/include/nvfuser/id_model/schedule.h +54 -0
- nvfuser/include/nvfuser/id_model/to_string.h +87 -0
- nvfuser/include/nvfuser/id_model/transform_replay.h +58 -0
- nvfuser/include/nvfuser/id_model/utils.h +176 -0
- nvfuser/include/nvfuser/id_model/validation_utils.h +55 -0
- nvfuser/include/nvfuser/index_compute.h +651 -0
- nvfuser/include/nvfuser/instrumentation.h +107 -0
- nvfuser/include/nvfuser/ir/all_nodes.h +14 -0
- nvfuser/include/nvfuser/ir/base_nodes.h +687 -0
- nvfuser/include/nvfuser/ir/builder.h +215 -0
- nvfuser/include/nvfuser/ir/builder_passkey.h +29 -0
- nvfuser/include/nvfuser/ir/cloner.h +185 -0
- nvfuser/include/nvfuser/ir/container.h +226 -0
- nvfuser/include/nvfuser/ir/graphviz.h +119 -0
- nvfuser/include/nvfuser/ir/interface_nodes.h +957 -0
- nvfuser/include/nvfuser/ir/internal_base_nodes.h +744 -0
- nvfuser/include/nvfuser/ir/internal_nodes.h +2792 -0
- nvfuser/include/nvfuser/ir/iostream.h +98 -0
- nvfuser/include/nvfuser/ir/printer.h +57 -0
- nvfuser/include/nvfuser/ir/utils.h +801 -0
- nvfuser/include/nvfuser/iter_visitor.h +661 -0
- nvfuser/include/nvfuser/kernel.h +299 -0
- nvfuser/include/nvfuser/kernel_db/kernel_db.h +109 -0
- nvfuser/include/nvfuser/kernel_db/utils.h +37 -0
- nvfuser/include/nvfuser/kernel_ir.h +1457 -0
- nvfuser/include/nvfuser/kernel_ir_dispatch.h +147 -0
- nvfuser/include/nvfuser/linked_hash_map.h +97 -0
- nvfuser/include/nvfuser/logical_domain_map.h +577 -0
- nvfuser/include/nvfuser/macros.h +23 -0
- nvfuser/include/nvfuser/mma_type.h +257 -0
- nvfuser/include/nvfuser/multidevice/c10d_mock.h +175 -0
- nvfuser/include/nvfuser/multidevice/communication.h +232 -0
- nvfuser/include/nvfuser/multidevice/communicator.h +179 -0
- nvfuser/include/nvfuser/multidevice/device_mesh.h +95 -0
- nvfuser/include/nvfuser/multidevice/executor.h +107 -0
- nvfuser/include/nvfuser/multidevice/multidevice.h +18 -0
- nvfuser/include/nvfuser/multidevice/utils.h +187 -0
- nvfuser/include/nvfuser/non_divisible_split.h +86 -0
- nvfuser/include/nvfuser/opaque_type.h +129 -0
- nvfuser/include/nvfuser/ops/alias.h +192 -0
- nvfuser/include/nvfuser/ops/all_ops.h +13 -0
- nvfuser/include/nvfuser/ops/arith.h +712 -0
- nvfuser/include/nvfuser/ops/composite.h +130 -0
- nvfuser/include/nvfuser/ops/indexing.h +55 -0
- nvfuser/include/nvfuser/ops/normalization.h +263 -0
- nvfuser/include/nvfuser/ops/utils.h +127 -0
- nvfuser/include/nvfuser/options.h +313 -0
- nvfuser/include/nvfuser/parallel_dimension_map.h +95 -0
- nvfuser/include/nvfuser/parallel_type_bitmap.h +365 -0
- nvfuser/include/nvfuser/polymorphic_value.h +432 -0
- nvfuser/include/nvfuser/predicate_compute.h +213 -0
- nvfuser/include/nvfuser/python_frontend/distributed_tensor.h +50 -0
- nvfuser/include/nvfuser/python_frontend/fusion_cache.h +298 -0
- nvfuser/include/nvfuser/python_frontend/fusion_definition.h +372 -0
- nvfuser/include/nvfuser/python_frontend/fusion_record.h +3124 -0
- nvfuser/include/nvfuser/python_frontend/fusion_state.h +143 -0
- nvfuser/include/nvfuser/python_frontend/python_bindings.h +27 -0
- nvfuser/include/nvfuser/python_frontend/segmentation.h +246 -0
- nvfuser/include/nvfuser/python_frontend/translation.h +20 -0
- nvfuser/include/nvfuser/python_frontend/translation_utils.h +308 -0
- nvfuser/include/nvfuser/scheduler/all_schedulers.h +17 -0
- nvfuser/include/nvfuser/scheduler/ampere_multi_matmul.h +206 -0
- nvfuser/include/nvfuser/scheduler/cache_policy_refiner.h +19 -0
- nvfuser/include/nvfuser/scheduler/compile_time_info.h +322 -0
- nvfuser/include/nvfuser/scheduler/debug_utils.h +68 -0
- nvfuser/include/nvfuser/scheduler/expr_eval_sched.h +45 -0
- nvfuser/include/nvfuser/scheduler/heuristic.h +113 -0
- nvfuser/include/nvfuser/scheduler/hopper_multi_matmul.h +204 -0
- nvfuser/include/nvfuser/scheduler/mark_aliases.h +19 -0
- nvfuser/include/nvfuser/scheduler/matmul.h +40 -0
- nvfuser/include/nvfuser/scheduler/matmul_heuristic.h +293 -0
- nvfuser/include/nvfuser/scheduler/matmul_heuristic_plugin.h +65 -0
- nvfuser/include/nvfuser/scheduler/matmul_heuristic_plugin_api.h +99 -0
- nvfuser/include/nvfuser/scheduler/matmul_utils.h +54 -0
- nvfuser/include/nvfuser/scheduler/mma_utils.h +500 -0
- nvfuser/include/nvfuser/scheduler/multi_matmul.h +74 -0
- nvfuser/include/nvfuser/scheduler/no_op.h +48 -0
- nvfuser/include/nvfuser/scheduler/normalization_inner.h +49 -0
- nvfuser/include/nvfuser/scheduler/normalization_inner_outer.h +51 -0
- nvfuser/include/nvfuser/scheduler/normalization_outer.h +48 -0
- nvfuser/include/nvfuser/scheduler/normalization_utils.h +379 -0
- nvfuser/include/nvfuser/scheduler/pointwise.h +183 -0
- nvfuser/include/nvfuser/scheduler/pointwise_heuristic.h +118 -0
- nvfuser/include/nvfuser/scheduler/pointwise_utils.h +24 -0
- nvfuser/include/nvfuser/scheduler/reduction.h +43 -0
- nvfuser/include/nvfuser/scheduler/reduction_heuristic.h +339 -0
- nvfuser/include/nvfuser/scheduler/reduction_utils.h +159 -0
- nvfuser/include/nvfuser/scheduler/registry.h +97 -0
- nvfuser/include/nvfuser/scheduler/registry_utils.h +111 -0
- nvfuser/include/nvfuser/scheduler/resize.h +41 -0
- nvfuser/include/nvfuser/scheduler/resize_heuristic.h +67 -0
- nvfuser/include/nvfuser/scheduler/runtime_info.h +166 -0
- nvfuser/include/nvfuser/scheduler/scheduler_types.h +80 -0
- nvfuser/include/nvfuser/scheduler/transpose.h +114 -0
- nvfuser/include/nvfuser/scheduler/transpose_heuristic.h +164 -0
- nvfuser/include/nvfuser/scheduler/utils.h +771 -0
- nvfuser/include/nvfuser/scheduler/vectorize_helper.h +349 -0
- nvfuser/include/nvfuser/serde/factory.h +55 -0
- nvfuser/include/nvfuser/serde/fusion_cache_generated.h +4319 -0
- nvfuser/include/nvfuser/serde/fusion_record.h +124 -0
- nvfuser/include/nvfuser/serde/polymorphic_value.h +52 -0
- nvfuser/include/nvfuser/serde/utils.h +34 -0
- nvfuser/include/nvfuser/struct.inl +127 -0
- nvfuser/include/nvfuser/swizzle.h +54 -0
- nvfuser/include/nvfuser/sys_utils.h +40 -0
- nvfuser/include/nvfuser/tensor_metadata.h +118 -0
- nvfuser/include/nvfuser/tma.h +124 -0
- nvfuser/include/nvfuser/transform_iter.h +522 -0
- nvfuser/include/nvfuser/transform_replay.h +297 -0
- nvfuser/include/nvfuser/transform_rfactor.h +33 -0
- nvfuser/include/nvfuser/transform_view.h +136 -0
- nvfuser/include/nvfuser/type.h +1125 -0
- nvfuser/include/nvfuser/type_promotion.h +61 -0
- nvfuser/include/nvfuser/utils.h +619 -0
- nvfuser/include/nvfuser/val_graph.h +446 -0
- nvfuser/include/nvfuser/val_graph_visitor.h +259 -0
- nvfuser/include/nvfuser/validator_utils.h +92 -0
- nvfuser/include/nvfuser/vectorization_info.h +31 -0
- nvfuser/include/nvfuser/visibility.h +21 -0
- nvfuser/lib/libnvfuser_codegen.so +0 -0
- nvfuser/nvfuser_version.py +69 -0
- nvfuser/pytorch_utils.py +184 -0
- nvfuser/share/cmake/nvfuser/NvfuserConfig-release.cmake +20 -0
- nvfuser/share/cmake/nvfuser/NvfuserConfig.cmake +106 -0
- nvfuser/utils.py +18 -0
- nvfuser/version.py +1 -0
- nvfuser_cu121_torch25-0.2.25.dev20250201.dist-info/LICENSE +976 -0
- nvfuser_cu121_torch25-0.2.25.dev20250201.dist-info/METADATA +16 -0
- nvfuser_cu121_torch25-0.2.25.dev20250201.dist-info/RECORD +242 -0
- nvfuser_cu121_torch25-0.2.25.dev20250201.dist-info/WHEEL +5 -0
- nvfuser_cu121_torch25-0.2.25.dev20250201.dist-info/top_level.txt +1 -0
- nvfuser_cu121_torch25.libs/libnvToolsExt-847d78f2.so.1.0.0 +0 -0
@@ -0,0 +1,313 @@
|
|
1
|
+
// clang-format off
|
2
|
+
/*
|
3
|
+
* SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
|
4
|
+
* All rights reserved.
|
5
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
6
|
+
*/
|
7
|
+
// clang-format on
|
8
|
+
#pragma once
|
9
|
+
|
10
|
+
#include <exceptions.h>
|
11
|
+
#include <visibility.h>
|
12
|
+
|
13
|
+
#include <algorithm>
|
14
|
+
#include <string>
|
15
|
+
#include <unordered_map>
|
16
|
+
#include <vector>
|
17
|
+
|
18
|
+
namespace nvfuser {
|
19
|
+
|
20
|
+
//! Types of debug print-outs
|
21
|
+
//!
|
22
|
+
//! These can be set through the `NVFUSER_DUMP` environment variable
|
23
|
+
//!
|
24
|
+
enum class DebugDumpOption {
|
25
|
+
FunctionTrace, //!< Dump the function trace of selected internal function. The
|
26
|
+
//!< function of interest needs to be instrumented with
|
27
|
+
//!< DEBUG_PRINT_SCOPE and optionally RECORD_AND_RETURN before
|
28
|
+
//!< it can be traced. If RECORD_AND_RETURN is not used,
|
29
|
+
//!< function tracing will still work, but it will not be able
|
30
|
+
//!< to print the return value and the line of the return
|
31
|
+
//!< statement. If you are interested in tracing a specific
|
32
|
+
//!< function while developing a PR, you are recommended to
|
33
|
+
//!< keep the instrumentation code in your PR and so later
|
34
|
+
//!< people can use it after committed to the main branch.
|
35
|
+
FusionIrOriginal, //!< Dump the original fusion IR built by the Python API
|
36
|
+
FusionIrConcretized, //!< Dump the Fusion IR after concretization
|
37
|
+
FusionIrPreseg, //!< Dump the Fusion IR after pre-segmenter optimization and
|
38
|
+
//!< before segmentation
|
39
|
+
FusionIrPresched, //!< Dump the segmented Fusion IR before it is scheduled
|
40
|
+
// TODO(wujingyue): name the following FusionIrSched
|
41
|
+
FusionIr, //!< Dump the Fusion IR before lowering. This is the Fusion IR fed
|
42
|
+
//!< to `KernelExecutor::compile`.
|
43
|
+
FusionIrGraph, //!< Dump a GraphViz graph of the Fusion IR
|
44
|
+
FusionIrMath, //!< Dump just the compute (math) part of the above `FusionIr`
|
45
|
+
//!< for conciseness
|
46
|
+
KernelIr, //!< Dump the compiler Kernel IR
|
47
|
+
ComputeAtMap, //!< Dump the computeAt map
|
48
|
+
CudaKernel, //!< Dump the generated CUDA C++ kernel code
|
49
|
+
CudaFull, //!< Dump the complete CUDA C++ code
|
50
|
+
CudaToFile, //!< Dump CUDA Strings to File
|
51
|
+
LaunchParam, //!< Dump the Launch parameters of kernel
|
52
|
+
FusionSegments, //!< Dump Segmented Fusion Graph
|
53
|
+
FusionSegmenterLog, //!< Dump Detailed Segmenter Logging
|
54
|
+
FusionArgs, //!< Print the runtime fusion arguments
|
55
|
+
GlobalZeroedMemory, //!< Print the log for zeroed global memory allocator
|
56
|
+
HostIr, //!< Dump the Host IR program
|
57
|
+
KernelArgs, //!< Print the runtime kernel arguments when launching kernels
|
58
|
+
FusionSegmentsDrawing, //!< Dump Segmented Fusion Graph
|
59
|
+
PrintPtxasLog, //!< Print the ptxas verbose log including register usage
|
60
|
+
BufferReuseInfo, //!< Dump the analysis details of local/shared buffer re-use
|
61
|
+
SchedulerDebug, //! Dump scheduler heuristic parameters
|
62
|
+
SchedulerVerbose, //! Dump detailed scheduler logging
|
63
|
+
ParallelDimensions, //!< Dump known parallel dimensions
|
64
|
+
PerfDebugVerbose, //! When running kernels, print verbose information
|
65
|
+
//! associated with what's running
|
66
|
+
PreSegmenterLogging,
|
67
|
+
PythonDefinition, //! Python Frontend Fusion Definition.
|
68
|
+
PythonDefinitionSegments, //! Python Frontend Fusion Definition of segments.
|
69
|
+
PythonFrontendDebug, //! Python Frontend debug information.
|
70
|
+
TransformPropagator, //! When running TransformPropagator, print propagation
|
71
|
+
//! path and replay result
|
72
|
+
Cubin, //! Dump compiled CUBIN
|
73
|
+
Sass, // Dump disassembled SASS
|
74
|
+
Ptx, //! Dump compiled PTX
|
75
|
+
BankConflictInfo, //! Dump bank confliction info
|
76
|
+
SyncMap, //! RAW dependency info
|
77
|
+
LowerVerbose, //! Print all passes' transform in GpuLower::lower
|
78
|
+
ExprSimplification, //! Print all passes' transform in simplifyExpr
|
79
|
+
ExprSort, //! Print merging decisions on expression sorting
|
80
|
+
ExprSortVerbose, //! Print verbose debug info on expression sorting
|
81
|
+
LoopRotation, //! Print loop rotation log
|
82
|
+
Occupancy, // Dump occupancy
|
83
|
+
IndexType, //! Print the index type of the launched kernel
|
84
|
+
PredicateElimination, //! Print the predicate elimination information
|
85
|
+
IndexingVerbose, //! Print verbose debug info on indexing
|
86
|
+
EndOfOption //! Placeholder for counting the number of elements
|
87
|
+
};
|
88
|
+
|
89
|
+
//! Types of features to enable
|
90
|
+
//!
|
91
|
+
//! These can be set through the `NVFUSER_ENABLE` environment variable
|
92
|
+
//!
|
93
|
+
enum class EnableOption {
|
94
|
+
FuseMatmul, //! Enable automatic fusion of matmul and linear ops
|
95
|
+
FuseMultipleMatmuls, //! Allow fusing more than one matmul in a single kernel
|
96
|
+
IdModel, //! Enable IdModel
|
97
|
+
IdModelExtraValidation, //! Enable extra error checking when building IdModel
|
98
|
+
IoToLowerPrecision, //! Enable castInputOutputToLowerPrecision. #1889 explains
|
99
|
+
//! why we disabled it by default.
|
100
|
+
KernelDb, //! Enable Kernel Database
|
101
|
+
KernelDebug, //! Enable debug mode in nvrtc
|
102
|
+
KernelLineInfo, //! Embed line info to compiled kernel, and dump the full CUDA
|
103
|
+
//! C++ code
|
104
|
+
KernelProfile, //! Enable intra-kernel performance profiling
|
105
|
+
MemoryPromotion, //! Enable promotion of memory types for non-pointwise ops
|
106
|
+
ReuseZeroedMemory, //! Re-use zeroed memory used for grid synchronization
|
107
|
+
ResizeScheduler, //! Enable the resize scheduler
|
108
|
+
StaticFusionCount, //! Enable using single static count in kernel name
|
109
|
+
WarnRegisterSpill, //! Enable warnings of register spill
|
110
|
+
EndOfOption //! Placeholder for counting the number of elements
|
111
|
+
};
|
112
|
+
|
113
|
+
//! Types of features to disable
|
114
|
+
//!
|
115
|
+
//! These can be set through the `NVFUSER_DISABLE` environment variable
|
116
|
+
//!
|
117
|
+
enum class DisableOption {
|
118
|
+
CompileToSass, //! Disable direct compilation to sass so the ptx can be
|
119
|
+
//! examined
|
120
|
+
ContigIndexing, //! Disable contiguous indexing
|
121
|
+
ExprSimplify, //! Disable expression simplifier
|
122
|
+
Fallback, //! Disable fallback
|
123
|
+
Fma, //! Disable FMA instructions
|
124
|
+
GroupedGridWelfordOuterOpt, //! Disable use of outer-optimized
|
125
|
+
//! grouped grid welford kernel
|
126
|
+
IndexHoist, //! Disable index hoisting
|
127
|
+
MagicZero, //! Disable nvfuser_zero
|
128
|
+
MatmulExprEval, //! Disable ATen evaluation for the entire fusion containing
|
129
|
+
//! matmul
|
130
|
+
Nvtx, //! Disable NVTX instrumentation
|
131
|
+
ParallelCompile, //! Disable compiling Fusion segments in parallel
|
132
|
+
ParallelSerde, //! Disable deserializing FusionExecutorCache in parallel
|
133
|
+
PredicateElimination, //! Disable predicate elimination
|
134
|
+
PythonInlineDefinitions, //! Disable printing of inline definitions
|
135
|
+
KernelReuse, //! Disable re-using cached FusionKernelRuntimes with different
|
136
|
+
//! input shapes
|
137
|
+
VarNameRemapping, //! Disable variable name remapping
|
138
|
+
WelfordVectorization, //! Disable vectorizaton of Welford ops
|
139
|
+
ReuseMismatchedTypeRegisters, //! Disable explicitly re-using registers unless
|
140
|
+
//! types match
|
141
|
+
Multidevice, //! Disable creation of multidevice communicator. Mainly for
|
142
|
+
//! debugging. This option quickly disables the multidevice
|
143
|
+
//! module even when Fuser is built with multidevice support. We
|
144
|
+
//! need this in particular to investigate possible conflicts
|
145
|
+
//! between nvFuser communicator and the framework also setting
|
146
|
+
//! up `c10d::ProcessGroup`
|
147
|
+
EndOfOption //! Placeholder for counting the number of elements
|
148
|
+
};
|
149
|
+
|
150
|
+
//! Options to set for Fusion Profiling. Whenever the profiler
|
151
|
+
//! is enabled, its output can be queried from the FusionProfile object.
|
152
|
+
//! All options enable the profiler.
|
153
|
+
//!
|
154
|
+
//! These can be set through the `NVFUSER_PROF` environment variable
|
155
|
+
//!
|
156
|
+
enum class ProfilerOption {
|
157
|
+
Enable, //! Enables the profiler.
|
158
|
+
EnableNocupti, //! Enables the profiler, but disables CUPTI specific
|
159
|
+
//! profiling inorder to measure true host time without
|
160
|
+
//! overhead.
|
161
|
+
Print, //! Enables the profiler and prints the output to the console.
|
162
|
+
PrintNocupti, //! Enables the profiler, disables CUPTI specific
|
163
|
+
//! profiling inorder to measure true host time without
|
164
|
+
//! overhead, and prints the output to the console.
|
165
|
+
PrintVerbose, //! Enables the profiler and prints a complete set of columns
|
166
|
+
//! to the console. WARNING: The output is will wrap on small
|
167
|
+
//! screens!
|
168
|
+
EndOfOption //! Placeholder for counting the number of elements
|
169
|
+
};
|
170
|
+
|
171
|
+
//! The base template class for the options such as EnableOption
|
172
|
+
template <typename OptionEnum>
|
173
|
+
class Options {
|
174
|
+
public:
|
175
|
+
Options() : options_(getOptionsFromEnv()) {}
|
176
|
+
|
177
|
+
bool has(OptionEnum option) const {
|
178
|
+
return options_.count(option);
|
179
|
+
}
|
180
|
+
|
181
|
+
bool hasAny() const {
|
182
|
+
return !options_.empty();
|
183
|
+
}
|
184
|
+
|
185
|
+
const std::vector<std::string>& getArgs(OptionEnum option) const {
|
186
|
+
NVF_ERROR(has(option), "Option not set");
|
187
|
+
return options_.at(option);
|
188
|
+
}
|
189
|
+
|
190
|
+
bool hasArg(OptionEnum option, const std::string& arg) const {
|
191
|
+
if (!has(option)) {
|
192
|
+
return false;
|
193
|
+
}
|
194
|
+
const auto& args = getArgs(option);
|
195
|
+
return std::find(args.begin(), args.end(), arg) != args.end();
|
196
|
+
}
|
197
|
+
|
198
|
+
void set(OptionEnum option_type, std::vector<std::string> option = {}) {
|
199
|
+
options_[option_type] = option;
|
200
|
+
}
|
201
|
+
|
202
|
+
void unset(OptionEnum option_type) {
|
203
|
+
options_.erase(option_type);
|
204
|
+
}
|
205
|
+
|
206
|
+
NVF_API static std::unordered_map<OptionEnum, std::vector<std::string>>
|
207
|
+
getOptionsFromEnv();
|
208
|
+
|
209
|
+
protected:
|
210
|
+
std::unordered_map<OptionEnum, std::vector<std::string>> options_;
|
211
|
+
};
|
212
|
+
|
213
|
+
//! Utility class to temporarily overrride the Enable options,
|
214
|
+
//! including those provided by the environment variable
|
215
|
+
template <typename OptionEnum>
|
216
|
+
class NVF_API OptionsGuard {
|
217
|
+
public:
|
218
|
+
OptionsGuard() : prev_options_(getCurOptions()) {}
|
219
|
+
|
220
|
+
~OptionsGuard() {
|
221
|
+
getCurOptions() = prev_options_;
|
222
|
+
}
|
223
|
+
|
224
|
+
NVF_API static Options<OptionEnum>& getCurOptions();
|
225
|
+
|
226
|
+
private:
|
227
|
+
Options<OptionEnum> prev_options_;
|
228
|
+
};
|
229
|
+
|
230
|
+
// DebugDump options
|
231
|
+
template <>
|
232
|
+
NVF_API std::unordered_map<DebugDumpOption, std::vector<std::string>> Options<
|
233
|
+
DebugDumpOption>::getOptionsFromEnv();
|
234
|
+
|
235
|
+
using DebugDumpOptions = Options<DebugDumpOption>;
|
236
|
+
|
237
|
+
template <>
|
238
|
+
NVF_API Options<DebugDumpOption>& OptionsGuard<
|
239
|
+
DebugDumpOption>::getCurOptions();
|
240
|
+
|
241
|
+
using DebugDumpOptionsGuard = OptionsGuard<DebugDumpOption>;
|
242
|
+
|
243
|
+
NVF_API bool isDebugDumpEnabled(DebugDumpOption option);
|
244
|
+
|
245
|
+
const std::vector<std::string>& getDebugDumpArguments(DebugDumpOption option);
|
246
|
+
|
247
|
+
bool hasDebugDumpArgument(DebugDumpOption option, const std::string& arg);
|
248
|
+
|
249
|
+
// Enable options
|
250
|
+
template <>
|
251
|
+
NVF_API std::unordered_map<EnableOption, std::vector<std::string>> Options<
|
252
|
+
EnableOption>::getOptionsFromEnv();
|
253
|
+
|
254
|
+
using EnableOptions = Options<EnableOption>;
|
255
|
+
|
256
|
+
std::optional<EnableOption> stringToEnableOption(
|
257
|
+
const std::string& enable_option);
|
258
|
+
|
259
|
+
bool isOptionEnabled(EnableOption option);
|
260
|
+
|
261
|
+
const std::vector<std::string>& getEnableOptionArguments(EnableOption option);
|
262
|
+
|
263
|
+
bool hasEnableOptionArgument(EnableOption option, const std::string& arg);
|
264
|
+
|
265
|
+
template <>
|
266
|
+
NVF_API Options<EnableOption>& OptionsGuard<EnableOption>::getCurOptions();
|
267
|
+
|
268
|
+
using EnableOptionsGuard = OptionsGuard<EnableOption>;
|
269
|
+
|
270
|
+
// Disable options
|
271
|
+
template <>
|
272
|
+
NVF_API std::unordered_map<DisableOption, std::vector<std::string>> Options<
|
273
|
+
DisableOption>::getOptionsFromEnv();
|
274
|
+
|
275
|
+
using DisableOptions = Options<DisableOption>;
|
276
|
+
|
277
|
+
std::optional<DisableOption> stringToDisableOption(
|
278
|
+
const std::string& disable_option);
|
279
|
+
|
280
|
+
NVF_API bool isOptionDisabled(DisableOption option);
|
281
|
+
|
282
|
+
const std::vector<std::string>& getDisableOptionArguments(DisableOption option);
|
283
|
+
|
284
|
+
bool hasDisableOptionArgument(DisableOption option, const std::string& arg);
|
285
|
+
|
286
|
+
template <>
|
287
|
+
NVF_API Options<DisableOption>& OptionsGuard<DisableOption>::getCurOptions();
|
288
|
+
|
289
|
+
using DisableOptionsGuard = OptionsGuard<DisableOption>;
|
290
|
+
|
291
|
+
// Profiler Options
|
292
|
+
|
293
|
+
template <>
|
294
|
+
NVF_API std::unordered_map<ProfilerOption, std::vector<std::string>> Options<
|
295
|
+
ProfilerOption>::getOptionsFromEnv();
|
296
|
+
|
297
|
+
using ProfilerOptions = Options<ProfilerOption>;
|
298
|
+
|
299
|
+
// Specific queries for the Profiler Options
|
300
|
+
bool isProfilerEnabled();
|
301
|
+
bool isProfilerEnabledWithCupti();
|
302
|
+
bool isProfilerPrintingEnabled();
|
303
|
+
bool isProfilerPrintingVerbose();
|
304
|
+
|
305
|
+
const std::vector<std::string>& getProfilerOptionArguments(
|
306
|
+
ProfilerOption option);
|
307
|
+
|
308
|
+
template <>
|
309
|
+
NVF_API Options<ProfilerOption>& OptionsGuard<ProfilerOption>::getCurOptions();
|
310
|
+
|
311
|
+
using ProfilerOptionsGuard = OptionsGuard<ProfilerOption>;
|
312
|
+
|
313
|
+
} // namespace nvfuser
|
@@ -0,0 +1,95 @@
|
|
1
|
+
// clang-format off
|
2
|
+
/*
|
3
|
+
* SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
|
4
|
+
* All rights reserved.
|
5
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
6
|
+
*/
|
7
|
+
// clang-format on
|
8
|
+
#pragma once
|
9
|
+
|
10
|
+
#include <exceptions.h>
|
11
|
+
#include <ir/all_nodes.h>
|
12
|
+
#include <kernel_ir.h>
|
13
|
+
#include <visibility.h>
|
14
|
+
|
15
|
+
#include <string>
|
16
|
+
#include <unordered_map>
|
17
|
+
#include <unordered_set>
|
18
|
+
|
19
|
+
namespace nvfuser {
|
20
|
+
|
21
|
+
//! Maps TID/BID to its dimension.
|
22
|
+
class ParallelDimensionMap {
|
23
|
+
public:
|
24
|
+
void build(Fusion* fusion);
|
25
|
+
|
26
|
+
//! Returns the dimension of a ParallelType. nullptr is returned if
|
27
|
+
//! a ParallelType is unused. If a dimension is not a constant, return
|
28
|
+
//! blockDim/gridDim instead.
|
29
|
+
NVF_API Val* get(ParallelType pt) const;
|
30
|
+
|
31
|
+
//! Returns the raw dimension of a ParallelType. nullptr is returned if
|
32
|
+
//! a ParallelType is unused.
|
33
|
+
Val* getRaw(ParallelType pt) const;
|
34
|
+
|
35
|
+
//! True if the dimension of a ParallelType is known to be exact
|
36
|
+
NVF_API bool isExact(ParallelType pt) const;
|
37
|
+
|
38
|
+
std::string toString() const;
|
39
|
+
|
40
|
+
const std::unordered_map<ParallelType, Val*>& getMap() const {
|
41
|
+
return dim_map_;
|
42
|
+
}
|
43
|
+
|
44
|
+
//! Get the "compute" parallel dimension on the given ParallelType. In case
|
45
|
+
//! of no warp specialization, this is the same as getRaw(pt). If we are doing
|
46
|
+
//! warp specialization on pt, the result is getRaw(pt) - 1, because the last
|
47
|
+
//! of pt is used for loading circular buffer tensors.
|
48
|
+
Val* getRawCompute(ParallelType pt) const;
|
49
|
+
|
50
|
+
//! Get the number of threads per each CTA used for computation. When there is
|
51
|
+
//! no warp specialization, the result is trivial: it is just the product of
|
52
|
+
//! parallel dimensions of TIDx, TIDy and TIDz. If we do have warp
|
53
|
+
//! specialization, this returns the number of threads used for computing. For
|
54
|
+
//! example, if we have a simple kernel warp specialized on TIDy and all the
|
55
|
+
//! TIDx parallelized IterDomains have extent 32, and all the TIDy
|
56
|
+
//! parallelized IterDomains have extent 16, and there is no TIDz
|
57
|
+
//! parallelization, then we will have:
|
58
|
+
//! blockDim = (x=32, y=17, z=1)
|
59
|
+
//! And this function will return (32 * 16) because the extra one for TIDy is
|
60
|
+
//! introduced by warp specialization and only used for loading circular
|
61
|
+
//! buffer tensors.
|
62
|
+
Val* getNumComputeThreadsEachBlock() const;
|
63
|
+
|
64
|
+
//! Get if the kernel uses warp specialization
|
65
|
+
bool hasWarpSpecialization() const {
|
66
|
+
return !warp_specialized_types_.empty();
|
67
|
+
}
|
68
|
+
|
69
|
+
bool has(ParallelType pt) const {
|
70
|
+
return dim_map_.count(pt) > 0;
|
71
|
+
}
|
72
|
+
|
73
|
+
private:
|
74
|
+
//! TIDx may need to be marked as non-exact as it may be padded to a
|
75
|
+
//! multiple of the warp size.
|
76
|
+
void adjustMappingsForWarpPadding();
|
77
|
+
|
78
|
+
//! If we are doing warp specialization on pt, then we need to increase
|
79
|
+
//! the parallel dimension size of pt by one, where the extra one is used
|
80
|
+
//! as the load warp. In this case, pt becomes non-exact.
|
81
|
+
void setWarpSpecializeOn(ParallelType pt);
|
82
|
+
|
83
|
+
private:
|
84
|
+
//! Maps from parallel types to dimensions, which are constant if
|
85
|
+
//! a unique value is found.
|
86
|
+
std::unordered_map<ParallelType, Val*> dim_map_;
|
87
|
+
//! Set of parallel types whose dimensions are identified to be
|
88
|
+
//! exactly the same as extents of mapped domains.
|
89
|
+
std::unordered_set<ParallelType> exact_types_;
|
90
|
+
|
91
|
+
//! Set of parallel types that we are doing warp specialization on
|
92
|
+
std::unordered_set<ParallelType> warp_specialized_types_;
|
93
|
+
};
|
94
|
+
|
95
|
+
} // namespace nvfuser
|