{"action":"created","issue":{"url":"https://api.github.com/repos/halide/Halide/issues/712","labels_url":"https://api.github.com/repos/halide/Halide/issues/712/labels{/name}","comments_url":"https://api.github.com/repos/halide/Halide/issues/712/comments","events_url":"https://api.github.com/repos/halide/Halide/issues/712/events","html_url":"https://github.com/halide/Halide/pull/712","id":63982774,"number":712,"title":"Optimization levels for automatic scheduling","user":{"login":"tdenniston","id":934815,"avatar_url":"https://avatars.githubusercontent.com/u/934815?v=3","gravatar_id":"","url":"https://api.github.com/users/tdenniston","html_url":"https://github.com/tdenniston","followers_url":"https://api.github.com/users/tdenniston/followers","following_url":"https://api.github.com/users/tdenniston/following{/other_user}","gists_url":"https://api.github.com/users/tdenniston/gists{/gist_id}","starred_url":"https://api.github.com/users/tdenniston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdenniston/subscriptions","organizations_url":"https://api.github.com/users/tdenniston/orgs","repos_url":"https://api.github.com/users/tdenniston/repos","events_url":"https://api.github.com/users/tdenniston/events{/privacy}","received_events_url":"https://api.github.com/users/tdenniston/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-03-24T12:19:23Z","updated_at":"2015-03-25T15:34:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/halide/Halide/pulls/712","html_url":"https://github.com/halide/Halide/pull/712","diff_url":"https://github.com/halide/Halide/pull/712.diff","patch_url":"https://github.com/halide/Halide/pull/712.patch"},"body":"Hello,\r\n\r\nThis PR adds the notion of \"optimization levels\" for some simple automatic scheduling. The idea here is to offer better default schedules to the programmer. To use these default schedules, set the new `HL_SCHED_OPT` environment variable to 0, 1, or 2:\r\n\r\n- `HL_SCHED_OPT=0` is the default, which makes no changes to the schedule. This matches the current behavior.\r\n- `HL_SCHED_OPT=1` recursively schedules functions from the pipeline output according to the following heuristic: functions with a single callsite are inlined; functions called as a stencil are `compute_root`.\r\n- `HL_SCHED_OPT=2` first applies level 1, and then for each `compute_root` function, the outer dimension is parallelized and the inner dimension is vectorized (with a function type dependent vectorization factor).\r\n\r\nHigher levels can be implemented later (I have one in the pipeline).\r\n\r\nCurrently, optimizations level 1 and 2 reset all function schedules before running the heuristics. That means if the user manually schedules some portion of the pipeline, but requests one of these automatic schedules, the user-specified schedule changes are discarded.\r\n\r\nThis is my first foray into modifying Halide, so I'm sure there are changes that must be made before this can be entertained for merging."},"comment":{"url":"https://api.github.com/repos/halide/Halide/issues/comments/86084387","html_url":"https://github.com/halide/Halide/pull/712#issuecomment-86084387","issue_url":"https://api.github.com/repos/halide/Halide/issues/712","id":86084387,"user":{"login":"tdenniston","id":934815,"avatar_url":"https://avatars.githubusercontent.com/u/934815?v=3","gravatar_id":"","url":"https://api.github.com/users/tdenniston","html_url":"https://github.com/tdenniston","followers_url":"https://api.github.com/users/tdenniston/followers","following_url":"https://api.github.com/users/tdenniston/following{/other_user}","gists_url":"https://api.github.com/users/tdenniston/gists{/gist_id}","starred_url":"https://api.github.com/users/tdenniston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdenniston/subscriptions","organizations_url":"https://api.github.com/users/tdenniston/orgs","repos_url":"https://api.github.com/users/tdenniston/repos","events_url":"https://api.github.com/users/tdenniston/events{/privacy}","received_events_url":"https://api.github.com/users/tdenniston/received_events","type":"User","site_admin":false},"created_at":"2015-03-25T15:34:25Z","updated_at":"2015-03-25T15:34:25Z","body":"Also, I'm not sure what to do as far as naming these scheduling strategies goes. `ComputeRootAllStencils` is clear, but what should the \"level 2\" be named? `ComputeRootAllStencilsParallelizeVectorize` seems like a bit of a mouthful. And my eventual level 3 would be something even longer.\r\n\r\nOne alternative is to construct the different strategies such that they compose. Level 2 would then be the composition of `ComputeRootAllStencils` and `ParallelizeOuterVectorizeInner`. The programmer would have to specify both strategies explicitly."}}