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

Stride-based control #615

Open
SamirDroubi opened this issue Apr 7, 2024 · 0 comments
Open

Stride-based control #615

SamirDroubi opened this issue Apr 7, 2024 · 0 comments

Comments

@SamirDroubi
Copy link
Collaborator

It is unclear to me whether stride-based control within procedure is not supported due to a bunch of bugs/over-conservative implementations or if that's necessary for the analysis to work properly. Here are two examples:

The front-end fails to parse a program that contains stride-based control:

def test_stride():
    @proc
    def foo(x: [R][3]):
        if stride(x, 0) == 1:
            pass
        else:
            pass

which fails with the following:

src/exo/API.py:53: in proc
    return Procedure(parser.result())
src/exo/API.py:175: in __init__
    proc = InferEffects(proc).result()
src/exo/effectcheck.py:91: in __init__
    body, eff = self.map_stmts(self.orig_proc.body)
src/exo/effectcheck.py:135: in map_stmts
    new_s = self.map_s(s)
src/exo/effectcheck.py:185: in map_s
    orelse_effects = eff_filter(cond.negate(), orelse_effects)
src/exo/LoopIR_effects.py:150: in negate
    return negate_expr(self)
>                   assert False, "TODO: add != support explicitly..."
E                   AssertionError: TODO: add != support explicitly...

Using specialize:

def test_specialize_stride():
    @proc
    def foo(x: [R][3]):
        pass
    foo = specialize(foo, foo.body()[0], "stride(x, 0) == 1")
    print(foo)

which will fail with:

src/exo/API_scheduling.py:101: in __call__
    return self.func(*bound_args.args, **bound_args.kwargs)
src/exo/API_scheduling.py:2266: in specialize
    ir, fwd = scheduling.DoSpecialize(block._impl, conds)
exo.new_eff.SchedulingError: <<<unknown directive>>>: Invalid specialization condition.
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

No branches or pull requests

1 participant