mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 00:20:18 +01:00
[BE][3/6] fix typos in test/ (#157637)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/157637 Approved by: https://github.com/yewentao256, https://github.com/albanD ghstack dependencies: #156605
This commit is contained in:
parent
3f8e2e91ad
commit
c8d43cbc6e
|
|
@ -1168,7 +1168,6 @@ exclude_patterns = [
|
|||
'aten/src/ATen/native/[a-pA-P]*/**',
|
||||
'aten/src/ATen/[a-mA-M]*/**',
|
||||
'test/**',
|
||||
'test/[a-hA-h]*/**',
|
||||
]
|
||||
init_command = [
|
||||
'python3',
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ class _BaseDataSparsiferTestCase(TestCase):
|
|||
class _NormDataSparsifierTestCase(_BaseDataSparsiferTestCase):
|
||||
r"""This helper test class takes in any supported type of and runs some tests.
|
||||
This inherits the TestBaseDataSparsifierRuner wherein some functions are
|
||||
over-ridden to take accomodate the specific sparsifier.
|
||||
over-ridden to take accommodate the specific sparsifier.
|
||||
TODO: Change the structure by creating a separate test case class for each
|
||||
member function
|
||||
"""
|
||||
|
|
@ -770,7 +770,7 @@ class TestQuantizationUtils(TestCase):
|
|||
|
||||
# higher threshold as quantization occurs before sparsity
|
||||
threshold = (
|
||||
1 # zero points seem to have higher magnitude with sparsity occuring after
|
||||
1 # zero points seem to have higher magnitude with sparsity occurring after
|
||||
)
|
||||
|
||||
sl_emb1 = (torch.abs(dequant_emb1) < threshold).float().mean()
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ class TestCubicScheduler(TestCase):
|
|||
self.assertEqual(
|
||||
self._get_sparsity_levels(sparsifier),
|
||||
self.sorted_sparse_levels,
|
||||
msg="Sparsity level is not reaching the target level afer delta_t * n steps ",
|
||||
msg="Sparsity level is not reaching the target level after delta_t * n steps ",
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -699,14 +699,16 @@ class TestBenchmarkUtils(TestCase):
|
|||
8959166 /tmp/build/80754af9/python_15996 ... a3/envs/throwaway/bin/python3.6]
|
||||
...
|
||||
92821 /tmp/build/80754af9/python_15996 ... a3/envs/throwaway/bin/python3.6]
|
||||
91000 build/../torch/csrc/tensor/pytho ... ch/torch/lib/libtorch_python.so]
|
||||
91000 build/../torch/csrc/tensor/pytho ... ch/torch/lib/libtorch_python.so] # codespell:ignore
|
||||
91000 /data/users/test_user/repos/pyto ... nsors::get_default_scalar_type()
|
||||
90090 ???:pthread_mutex_lock [/usr/lib64/libpthread-2.28.so]
|
||||
90000 build/../c10/core/TensorImpl.h:c ... ch/torch/lib/libtorch_python.so]
|
||||
90000 build/../aten/src/ATen/record_fu ... torch/torch/lib/libtorch_cpu.so]
|
||||
90000 /data/users/test_user/repos/pyto ... uard(std::optional<c10::Device>)
|
||||
90000 /data/users/test_user/repos/pyto ... ersionCounter::~VersionCounter()
|
||||
88000 /data/users/test_user/repos/pyto ... ratorKernel*, at::Tensor const&)""",
|
||||
88000 /data/users/test_user/repos/pyto ... ratorKernel*, at::Tensor const&)""".replace(
|
||||
" # codespell:ignore", ""
|
||||
),
|
||||
)
|
||||
|
||||
self.regularizeAndAssertExpectedInline(
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ void transformer_encoder_layer_test_helper(
|
|||
ASSERT_TRUE(
|
||||
torch::allclose(result, ref_output, 1e-7, 1e-5, /*equal_nan=*/true));
|
||||
|
||||
// all 0 values are NOT masked. This should't mask anything
|
||||
// all 0 values are NOT masked. This shouldn't mask anything
|
||||
torch::Tensor mask = torch::tensor({{0}}, tensor_options) == 1;
|
||||
result = model(
|
||||
encoder_input,
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ set(BACKEND_WITH_COMPILER_SRCS
|
|||
)
|
||||
if(USE_KINETO)
|
||||
# Testing edge profiler for backend use
|
||||
# profiler_edge should only be aded when USE_KINETO flag is on
|
||||
# profiler_edge should only be added when USE_KINETO flag is on
|
||||
list(APPEND BACKEND_WITH_COMPILER_SRCS
|
||||
${TORCH_SRC_DIR}/csrc/jit/mobile/profiler_edge.cpp)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -789,7 +789,7 @@ TEST(
|
|||
c._save_for_mobile(ss, ExtraFilesMap(), true);
|
||||
auto c_loaded = _load_for_mobile(ss);
|
||||
/*
|
||||
* Erro stack trace will look like this:
|
||||
* Error stack trace will look like this:
|
||||
* Module hierarchy:top(C).A0(backend_with_compiler_demoLoweredModule).AA0(AA)
|
||||
* Traceback of TorchScript (most recent call last):
|
||||
* File "<string>", line 3, in FunctionName_UNKNOWN
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class BackendWithCompiler : public PyTorchBackendInterface {
|
|||
// forwards everything along. In a non toy setup this could grab information
|
||||
// from that runtime that might be relevant to execute, such as build flags
|
||||
// the resolution of the devices camera, or basically any runtime specific
|
||||
// information that wouldnt be available server side where preprocess is
|
||||
// information that wouldn't be available server side where preprocess is
|
||||
// called.
|
||||
c10::impl::GenericDict compile(
|
||||
c10::IValue processed,
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ TEST(LiteTrainerTest, Params) {
|
|||
AT_ASSERT(parameters[0].item<float>() == bc_parameters[0].item<float>());
|
||||
}
|
||||
|
||||
// TODO Renable these tests after parameters are correctly loaded on mobile
|
||||
// TODO Re-enable these tests after parameters are correctly loaded on mobile
|
||||
/*
|
||||
TEST(MobileTest, NamedParameters) {
|
||||
Module m("m");
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ TEST(RunTimeTest, DelegateException) {
|
|||
* inputs.emplace_back(torch::rand({2, 4}));
|
||||
* inputs.emplace_back(torch::rand({13, 9}));
|
||||
* Run with inputs and expect exception
|
||||
* Erro stack trace will look like this:
|
||||
* Error stack trace will look like this:
|
||||
* Module hierarchy:top(C).A0(backend_with_compiler_demoLoweredModule).AA0(AA)
|
||||
* Traceback of TorchScript (most recent call last):
|
||||
* File "<string>", line 3, in FunctionName_UNKNOWN
|
||||
|
|
|
|||
|
|
@ -1113,7 +1113,7 @@ TEST_F(Kernel, Softmax2D) {
|
|||
const auto verification_pattern =
|
||||
format(verification_template, ver_env);
|
||||
|
||||
// verification sting temporarily disabled until
|
||||
// verification string temporarily disabled until
|
||||
// inlining of exp() is benchmarked and determined
|
||||
// torch::jit::testing::FileCheck().run(verification_pattern,
|
||||
// oss.str());
|
||||
|
|
@ -1192,7 +1192,7 @@ TEST_F(Kernel, Softmax3D) {
|
|||
ver_env.d("softmax_dim_size", softmax_dim_size);
|
||||
const auto verification_pattern = format(verification_template, ver_env);
|
||||
|
||||
// verification sting temporarily disabled until
|
||||
// verification string temporarily disabled until
|
||||
// inlining of exp() is benchmarked and determined
|
||||
// torch::jit::testing::FileCheck().run(verification_pattern, oss.str());
|
||||
|
||||
|
|
@ -1275,7 +1275,7 @@ TEST_F(Kernel, Softmax4D) {
|
|||
ver_env.d("softmax_dim_size", softmax_dim_size);
|
||||
const auto verification_pattern = format(verification_template, ver_env);
|
||||
|
||||
// verification sting temporarily disabled until
|
||||
// verification string temporarily disabled until
|
||||
// inlining of exp() is benchmarked and determined
|
||||
// torch::jit::testing::FileCheck().run(verification_pattern, oss.str());
|
||||
|
||||
|
|
@ -1887,7 +1887,7 @@ graph(%x : int,
|
|||
auto rt = at::zeros({3}, TensorOptions(kCPU).dtype(at::kLong));
|
||||
|
||||
// Verify that TEK::runFast works correctly with mixed scalar and tensor
|
||||
// inputs/utputs
|
||||
// inputs/outputs
|
||||
std::vector<void*> inputs = {&x, xt.data_ptr(), &y, yt.data_ptr()};
|
||||
std::vector<void*> outputs = {&r, rt.data_ptr(), &z, zt.data_ptr()};
|
||||
k.runFast(inputs, outputs);
|
||||
|
|
@ -1897,7 +1897,7 @@ graph(%x : int,
|
|||
ASSERT_TRUE(at::equal(rt, zt * xt));
|
||||
|
||||
// Verify that TEK::run works correctly with mixed scalar and tensor
|
||||
// inputs/utputs
|
||||
// inputs/outputs
|
||||
std::vector<IValue> stack = {x, xt, y, yt};
|
||||
k.run(stack);
|
||||
TORCH_CHECK_EQ(stack[0], x * y * x);
|
||||
|
|
|
|||
|
|
@ -437,12 +437,12 @@ TEST(MemDependency, BoundSubtractMultiDim) {
|
|||
ASSERT_TRUE(EQ(
|
||||
subtractIndicesBounds({CB(0, 9), CB(0, 2)}, {CB(0, 10), CB(0, 20)}), {}));
|
||||
|
||||
// Mutli dim one way partial in dim 1.
|
||||
// Multi dim one way partial in dim 1.
|
||||
ASSERT_TRUE(
|
||||
EQ(subtractIndicesBounds({CB(0, 9), CB(0, 2)}, {CB(0, 3), CB(0, 2)}),
|
||||
{{CB(4, 9), CB(0, 2)}}));
|
||||
|
||||
// Mutli dim one way partial in dim 2.
|
||||
// Multi dim one way partial in dim 2.
|
||||
ASSERT_TRUE(
|
||||
EQ(subtractIndicesBounds({CB(0, 9), CB(0, 20)}, {CB(0, 9), CB(0, 10)}),
|
||||
{{CB(0, 9), CB(11, 20)}}));
|
||||
|
|
@ -939,7 +939,7 @@ TEST(MemDependency, MemDependencyCheckerLoopBounds) {
|
|||
*/
|
||||
|
||||
// Now let's look at the bounds of each access.
|
||||
// There are 9 accesses in this Stmt, so this is exhaustive, we wont do this
|
||||
// There are 9 accesses in this Stmt, so this is exhaustive, we won't do this
|
||||
// much.
|
||||
auto history = analyzer.getHistory();
|
||||
ASSERT_EQ(history.size(), 10);
|
||||
|
|
@ -1134,7 +1134,7 @@ TEST(MemDependency, MemDependencyCheckerLoopBoundsIndexShift) {
|
|||
// this case -1.
|
||||
ASSERT_TRUE(EQ(history[1]->bounds(), {CB(0, 8)}));
|
||||
// It depends on the input, but also the store in the same loop, since
|
||||
// different interations of the loop depend on each other.
|
||||
// different iterations of the loop depend on each other.
|
||||
ASSERT_EQ(history[1]->dependencies().size(), 2);
|
||||
ASSERT_TRUE(history[1]->hasDependency(history[0]));
|
||||
ASSERT_TRUE(history[1]->hasDependency(history[2]));
|
||||
|
|
|
|||
|
|
@ -333,7 +333,7 @@ TEST(Reductions, ReduceMinCustomInitializer) {
|
|||
cg.call({in, out, std::numeric_limits<float>::max()});
|
||||
ASSERT_EQ(out[0], 10);
|
||||
|
||||
// With an initalizer lower than the min, that's the min.
|
||||
// With an initializer lower than the min, that's the min.
|
||||
cg.call({in, out, 5.f});
|
||||
ASSERT_EQ(out[0], 5);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1254,7 +1254,7 @@ TEST(Registerizer, RegisterizerConditionInsideOverlap2) {
|
|||
* A[0] = 3;
|
||||
* A[x] = (A[x]) + 1;
|
||||
* }
|
||||
* int A_2 = A[x]; // A_2 initialier
|
||||
* int A_2 = A[x]; // A_2 initializer
|
||||
* B[x] = A_2; //
|
||||
* B[x + 1] = A_2; //
|
||||
* A_2 = C[x]; //
|
||||
|
|
@ -3064,7 +3064,7 @@ TEST(Registerizer, RegisterizerHiddenAccessNo) {
|
|||
}
|
||||
|
||||
// In this case the conditional access must be hoisted by two loops, there are
|
||||
// two accesses here one is unhidden and the other isnt. A[0] can be
|
||||
// two accesses here one is unhidden and the other isn't. A[0] can be
|
||||
// registerized but B[0] cannot.
|
||||
TEST(Registerizer, RegisterizerHiddenAccessMultiLoop) {
|
||||
BufHandle a("A", {10}, kInt);
|
||||
|
|
@ -3422,8 +3422,8 @@ TEST(Registerizer, RegisterizerMultiDim) {
|
|||
torch::jit::testing::FileCheck().run(verification_pattern, oss.str());
|
||||
}
|
||||
|
||||
// Wont registerize if only some dims match, but will still registerize distinct
|
||||
// elements.
|
||||
// Won't registerize if only some dims match, but will still registerize
|
||||
// distinct elements.
|
||||
TEST(Registerizer, RegisterizerMultiDimPartial) {
|
||||
BufHandle a("A", {3, 4, 5}, kInt);
|
||||
VarHandle x("x", kInt);
|
||||
|
|
|
|||
|
|
@ -2643,7 +2643,7 @@ TEST(Simplify, SimplifyWontReorderFloat) {
|
|||
VarHandle x("x", kFloat);
|
||||
VarHandle y("y", kFloat);
|
||||
// x%y - (x%y - 1) => x%y - (x%y - 1).
|
||||
// We wont reorder opaque ops if they are FP.
|
||||
// We won't reorder opaque ops if they are FP.
|
||||
ExprHandle body = (x % y) - ((x % y) - 1);
|
||||
ExprHandle simplified = IRSimplifier::simplify(body);
|
||||
|
||||
|
|
@ -2794,7 +2794,7 @@ TEST(Simplify, SimplifyRoundModPattern) {
|
|||
}
|
||||
|
||||
{
|
||||
// Sanity checking we wont do the optimization on floats.
|
||||
// Sanity checking we won't do the optimization on floats.
|
||||
VarHandle x("x", kFloat);
|
||||
VarHandle y("y", kFloat);
|
||||
ExprHandle body = ((x / y) * y) + (x % y);
|
||||
|
|
@ -2811,7 +2811,7 @@ TEST(Simplify, SimplifyRoundModPattern) {
|
|||
}
|
||||
|
||||
{
|
||||
// Sanity check we wont do it if the mod term doesn't match.
|
||||
// Sanity check we won't do it if the mod term doesn't match.
|
||||
VarHandle x("x", kInt);
|
||||
VarHandle y("y", kInt);
|
||||
VarHandle z("z", kInt);
|
||||
|
|
@ -2821,7 +2821,7 @@ TEST(Simplify, SimplifyRoundModPattern) {
|
|||
}
|
||||
|
||||
{
|
||||
// Sanity check we wont do it if the div term doesn't match.
|
||||
// Sanity check we won't do it if the div term doesn't match.
|
||||
VarHandle x("x", kInt);
|
||||
VarHandle y("y", kInt);
|
||||
VarHandle z("z", kInt);
|
||||
|
|
@ -2831,7 +2831,7 @@ TEST(Simplify, SimplifyRoundModPattern) {
|
|||
}
|
||||
|
||||
{
|
||||
// Sanity check we wont do it if the mul term doesn't match.
|
||||
// Sanity check we won't do it if the mul term doesn't match.
|
||||
VarHandle x("x", kInt);
|
||||
VarHandle y("y", kInt);
|
||||
VarHandle z("z", kInt);
|
||||
|
|
@ -3013,7 +3013,7 @@ TEST(Simplify, SimplifyModRoundModPattern) {
|
|||
}
|
||||
|
||||
{
|
||||
// Sanity checking we wont do the optimization on floats.
|
||||
// Sanity checking we won't do the optimization on floats.
|
||||
VarHandle x("x", kFloat);
|
||||
VarHandle y("y", kFloat);
|
||||
VarHandle z("z", kFloat);
|
||||
|
|
@ -4264,7 +4264,7 @@ TEST(Simplify, SimplifyReorderForCond) {
|
|||
|
||||
{
|
||||
// Condition uses distinct region of Tensor.
|
||||
// We could reorder here wih better analysis, but we don't. Included for
|
||||
// We could reorder here with better analysis, but we don't. Included for
|
||||
// completeness.
|
||||
auto body = For::make(
|
||||
i,
|
||||
|
|
@ -4643,7 +4643,7 @@ TEST(Simplify, SimplifyFuseConditions) {
|
|||
}
|
||||
|
||||
{
|
||||
// Sanity check wont fuse different non-CompareSelects.
|
||||
// Sanity check won't fuse different non-CompareSelects.
|
||||
auto body = Block::make(
|
||||
{Cond::make(i, Store::make(a, {0}, i), nullptr),
|
||||
Cond::make(j, Store::make(a, {1}, i), nullptr)});
|
||||
|
|
|
|||
|
|
@ -700,7 +700,7 @@ class TestConverter(TestCase):
|
|||
else:
|
||||
return self.w + self.m2(x)
|
||||
|
||||
# Super nested, parameters neeed to lifted
|
||||
# Super nested, parameters need to be lifted
|
||||
# multiple times.
|
||||
class SuperNestedM(torch.nn.Module):
|
||||
def __init__(self) -> None:
|
||||
|
|
@ -755,7 +755,7 @@ class TestConverter(TestCase):
|
|||
else:
|
||||
return self.linear(self.m2(x))
|
||||
|
||||
# Super nested, parameters neeed to lifted
|
||||
# Super nested, parameters need to be lifted
|
||||
# multiple times.
|
||||
class SuperNestedM1(torch.nn.Module):
|
||||
def __init__(self, dim: int) -> None:
|
||||
|
|
@ -771,7 +771,7 @@ class TestConverter(TestCase):
|
|||
return self.linear(self.m2(x))
|
||||
|
||||
# Super nested, even the input needs to be
|
||||
# lifted recursively due to value propogation optimiztaion.
|
||||
# lifted recursively due to value propagation optimization.
|
||||
class SuperNestedM2(torch.nn.Module):
|
||||
def __init__(self, dim: int) -> None:
|
||||
super().__init__()
|
||||
|
|
|
|||
|
|
@ -1871,7 +1871,7 @@ class GraphModule(torch.nn.Module):
|
|||
for problem in [Problem1, Problem2]:
|
||||
m = problem()
|
||||
m(torch.rand(64, 64))
|
||||
# simpified torch.distributed.pipeline code
|
||||
# simplified torch.distributed.pipeline code
|
||||
annotate_split_points(m, {"blocks.1": 1, "blocks.3": 1})
|
||||
gm = export(m, (torch.rand(64, 64),))
|
||||
torch.export.unflatten(gm)
|
||||
|
|
@ -8096,7 +8096,7 @@ def forward(self, x):
|
|||
str(schema),
|
||||
"""cond(SymBool pred, GraphModule true_fn, GraphModule false_fn, Tensor[2] operands) -> Tensor[1]""",
|
||||
)
|
||||
# serdes deserailizes tuple as list
|
||||
# serdes deserializes tuple as list
|
||||
if need_serdes_test(self._testMethodName):
|
||||
self.assertExpectedInline(
|
||||
ep.graph_module.code.strip(),
|
||||
|
|
@ -9232,7 +9232,7 @@ graph():
|
|||
x = torch.rand(5, 2, 2)
|
||||
model = Model()
|
||||
|
||||
# Manualy set the fake_device of fake tensors.
|
||||
# Manually set the fake_device of fake tensors.
|
||||
x.fake_device = torch.device("cuda:0")
|
||||
for n, p in model.named_parameters():
|
||||
p.fake_device = torch.device("cuda:0")
|
||||
|
|
@ -13562,7 +13562,7 @@ graph():
|
|||
self.assertTrue(torch.allclose(m(x2), ep.module()(x2)))
|
||||
self.assertTrue(torch.allclose(m(x1), ep.module()(x1)))
|
||||
|
||||
@testing.expectedFailureSerDerNonStrict # construtor is not serialized today
|
||||
@testing.expectedFailureSerDerNonStrict # constructor is not serialized today
|
||||
@testing.expectedFailureSerDer # constructor is not serialized today
|
||||
@testing.expectedFailureRetraceability # dynamo doesn't work with FlatApply op
|
||||
def test_capture_subclass_constructor(self):
|
||||
|
|
|
|||
|
|
@ -1274,7 +1274,7 @@ class TestCompileTorchbind(TestCase):
|
|||
self.assertEqual(cnt.frame_count, 1)
|
||||
|
||||
tq2 = _empty_tensor_queue()
|
||||
# make first tensor's secon dim dynamic
|
||||
# make first tensor's second dim dynamic
|
||||
tq2.push(torch.randn(2, 4, requires_grad=False))
|
||||
torch.compile(mod, backend=cnt)(tq2, x)
|
||||
self.assertEqual(cnt.frame_count, 2)
|
||||
|
|
|
|||
|
|
@ -2372,7 +2372,7 @@ def forward(self, arg0_1, arg1_1):
|
|||
return a.mul(3), b.mul(4)
|
||||
|
||||
inp = [
|
||||
# First inp doesnt require grad, but we switch it on
|
||||
# First inp doesn't require grad, but we switch it on
|
||||
torch.ones(3, 3, requires_grad=False),
|
||||
torch.ones(3, 3, requires_grad=True),
|
||||
]
|
||||
|
|
@ -5670,7 +5670,7 @@ def forward(self, primals_1, tangents_1):
|
|||
_, fw_graph_out_nodes = get_ins_outs(fw_graph)
|
||||
self.assertEqual(
|
||||
# fw outputs include b.size() which expands to 2 symints,
|
||||
# then 4 tensors (transposes of matricies used for mm) are saved
|
||||
# then 4 tensors (transposes of matrices used for mm) are saved
|
||||
# finally 3 symints are saved
|
||||
[False, True, True, False, False] + [False] * 4 + [True] * 3,
|
||||
[is_sym_node(n) for n in fw_graph_out_nodes],
|
||||
|
|
@ -6000,7 +6000,7 @@ metadata incorrectly.
|
|||
self.assertEqual(b_test.a, b_ref.a)
|
||||
self.assertEqual(b_test.b, b_ref.b)
|
||||
|
||||
# NOTE: we need to use b in our gradient compute. Otherwise we will need to recompile teh backward.
|
||||
# NOTE: we need to use b in our gradient compute. Otherwise we will need to recompile the backward.
|
||||
(b_ref * out_ref).sum().backward()
|
||||
(b_test * out_test).sum().backward()
|
||||
# Both grad_inputs are TwoTensor
|
||||
|
|
|
|||
|
|
@ -2013,7 +2013,7 @@ def forward(self, pred_1, x_1):
|
|||
if autograd:
|
||||
self.check_autograd(result, expected_result, (init, inp))
|
||||
|
||||
# TODO: Does not work because of the usage of vmap witin associative_scan
|
||||
# TODO: Does not work because of the usage of vmap within associative_scan
|
||||
# The paT206899919 rameterization is commented out for the moment and the test is marked with expected fail
|
||||
# Fails with: AssertionError: scan is not an OpOverload
|
||||
@skipIfRocm(msg="Unsupported on ROCM yet")
|
||||
|
|
@ -4143,7 +4143,7 @@ class GraphModule(torch.nn.Module):
|
|||
inputs=inp,
|
||||
)
|
||||
|
||||
# TODO: Does not work because of the usage of vmap witin associative_scan
|
||||
# TODO: Does not work because of the usage of vmap within associative_scan
|
||||
# TODO: Re-enable additional parameters again once this issues has been resolved
|
||||
@unittest.skipIf(not SM70OrLater, "triton")
|
||||
@requires_cuda
|
||||
|
|
@ -4241,7 +4241,7 @@ class GraphModule(torch.nn.Module):
|
|||
inputs=inp,
|
||||
)
|
||||
|
||||
# TODO: Does not work because of the usage of vmap witin associative_scan
|
||||
# TODO: Does not work because of the usage of vmap within associative_scan
|
||||
# TODO: Re-enable additional parameters again once this issues has been resolved
|
||||
@unittest.skipIf(not SM70OrLater, "triton")
|
||||
@requires_cuda
|
||||
|
|
@ -4314,7 +4314,7 @@ class GraphModule(torch.nn.Module):
|
|||
inputs=inp,
|
||||
)
|
||||
|
||||
# TODO: Does not work because of the usage of vmap witin associative_scan
|
||||
# TODO: Does not work because of the usage of vmap within associative_scan
|
||||
# TODO: Re-enable additional parameters again once this issues has been resolved
|
||||
@unittest.skipIf(not SM70OrLater, "triton")
|
||||
@requires_cuda
|
||||
|
|
@ -5315,7 +5315,7 @@ def forward(self, arg0_1):
|
|||
)
|
||||
|
||||
@parametrize("func_type", ["no", "cpp", "python", "functorch"])
|
||||
# - "simple_with_linear" and "nested_with_linear" doesn't work becaue parameters and buffers
|
||||
# - "simple_with_linear" and "nested_with_linear" doesn't work because parameters and buffers
|
||||
# are not inputs so they're not wrapped by functionalization and tracing.
|
||||
#
|
||||
# - make_fx tracing mode "real" fails for "int_carry", "pytree_int_carry" and "const_and_symint_output"
|
||||
|
|
|
|||
|
|
@ -4230,7 +4230,7 @@ class TestVmapOperatorsOpInfo(TestCase):
|
|||
xfail("as_strided_copy"),
|
||||
xfail(
|
||||
"as_strided_scatter"
|
||||
), # no batching rule implemented, default doesnt work
|
||||
), # no batching rule implemented, default doesn't work
|
||||
skip(
|
||||
"new_empty_strided"
|
||||
), # empty tensor data is garbage so it's hard to make comparisons with it
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class TestLazyGraphModule(TestCase):
|
|||
|
||||
def test_needs_recompile(self):
|
||||
"""
|
||||
Make sure needs_recompile() return the corrent state.
|
||||
Make sure needs_recompile() return the correct state.
|
||||
"""
|
||||
|
||||
def f(x):
|
||||
|
|
@ -141,7 +141,7 @@ class TestLazyGraphModule(TestCase):
|
|||
self.assertTrue(isinstance(gm2, _LazyGraphModule))
|
||||
self.assertTrue(gm2._needs_recompile())
|
||||
|
||||
# make_fx will cal foward method of gm. That clears the _needs_recompile()
|
||||
# make_fx will cal forward method of gm. That clears the _needs_recompile()
|
||||
# flag.
|
||||
self.assertFalse(gm._needs_recompile())
|
||||
|
||||
|
|
@ -175,7 +175,7 @@ class TestLazyGraphModule(TestCase):
|
|||
|
||||
def test_save_lazy_foward(self):
|
||||
"""
|
||||
Save the lazy forward method and call it repeatly. Make sure we
|
||||
Save the lazy forward method and call it repeatedly. Make sure we
|
||||
don't recompile for each such call.
|
||||
"""
|
||||
|
||||
|
|
|
|||
|
|
@ -36,9 +36,9 @@ class TestPartitionerOrder(TestCase):
|
|||
def test_partitioner_order(self):
|
||||
m = AddModule()
|
||||
traced_m = torch.fx.symbolic_trace(m)
|
||||
partions = DummyPartitioner(traced_m).propose_partitions()
|
||||
partion_nodes = [list(partition.nodes) for partition in partions]
|
||||
node_order = [n.name for n in partion_nodes[0]]
|
||||
partitions = DummyPartitioner(traced_m).propose_partitions()
|
||||
partition_nodes = [list(partition.nodes) for partition in partitions]
|
||||
node_order = [n.name for n in partition_nodes[0]]
|
||||
for _ in range(10):
|
||||
traced_m = torch.fx.symbolic_trace(m)
|
||||
new_partion = DummyPartitioner(traced_m).propose_partitions()
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ class TestPassManager(TestCase):
|
|||
|
||||
def test_topological_sort(self):
|
||||
"""
|
||||
Tests that passes are correctly ordered based on contraints.
|
||||
Tests that passes are correctly ordered based on constraints.
|
||||
"""
|
||||
|
||||
def pass0(x):
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ class TestInvokeQuantInductor(TestInvokeQuant):
|
|||
|
||||
@skipIfXpu(
|
||||
msg="MM Triton template fusion for XPU not work because the fusion"
|
||||
" can not speedup, unskip untill #146568 fixed."
|
||||
" can not speedup, unskip until #146568 fixed."
|
||||
)
|
||||
@requires_gpu()
|
||||
@config.patch(prologue_fusion=True)
|
||||
|
|
|
|||
|
|
@ -1079,7 +1079,7 @@ class GraphModule(torch.nn.Module):
|
|||
|
||||
fake_prop_count = 0
|
||||
|
||||
def _mock_invoke_subgraph(mode, subgraph, identifer, *operands):
|
||||
def _mock_invoke_subgraph(mode, subgraph, identifier, *operands):
|
||||
nonlocal fake_prop_count
|
||||
fake_prop_count += 1
|
||||
return (operands[0].clone(),)
|
||||
|
|
@ -2077,7 +2077,7 @@ class GraphModule(torch.nn.Module):
|
|||
|
||||
# NOTE THAT THIS TEST DOES NOT REALLY WORK
|
||||
# We wanted one invoke_subgraph called twice, but because of
|
||||
# constant_args_idx changing in the grpah, the graph equivalence fails
|
||||
# constant_args_idx changing in the graph, the graph equivalence fails
|
||||
|
||||
if not TEST_WITH_CROSSREF:
|
||||
self.assertExpectedInline(
|
||||
|
|
|
|||
|
|
@ -1,9 +1,18 @@
|
|||
aLoad
|
||||
aLoads
|
||||
ans
|
||||
aStore
|
||||
aStores
|
||||
belows
|
||||
bLoad
|
||||
bLoads
|
||||
bStore
|
||||
bStores
|
||||
BU
|
||||
contiguities
|
||||
contiguity
|
||||
coo
|
||||
deser
|
||||
din
|
||||
dout
|
||||
ElementE
|
||||
|
|
|
|||
|
|
@ -1843,11 +1843,11 @@ bool LoopNest::hasLoopCarriedDependence(const ForPtr& loop) {
|
|||
auto bLoads = NodeFinder<Load>::find(*it2);
|
||||
// ReadAfterWrite
|
||||
for (auto& aStore : aStores) {
|
||||
for (auto& bLoad : bLoads) { // codespell:ignore
|
||||
for (auto& bLoad : bLoads) {
|
||||
if (aStore->buf() == bLoad->buf()) {
|
||||
if (!areIndicesLoopIndependent(
|
||||
aStore->indices(), bLoad->indices(), outer_loop_vars)) {
|
||||
if (isOverlapping(analyzer, aStore, bLoad)) { // codespell:ignore
|
||||
if (isOverlapping(analyzer, aStore, bLoad)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user