Skip to content

[wip][auto_scheduler] buffer support, correctness check#7053

Closed
antinucleon wants to merge 6 commits intoapache:mainfrom
antinucleon:metal
Closed

[wip][auto_scheduler] buffer support, correctness check#7053
antinucleon wants to merge 6 commits intoapache:mainfrom
antinucleon:metal

Conversation

@antinucleon
Copy link
Contributor

@antinucleon antinucleon commented Dec 8, 2020

This PR enables correctness check for a generated schedule.

It is useful for:

  • Metal / ROCM: For some invalid schedule, driver may skip it instead of return any errors (which will show as an impossble large FLOPS number)
  • Sparse kernel search

Example 1: correctness check. This will generate random buffers for correctness check

    if train_flag:
      #measure_ctx = auto_scheduler.LocalRPCMeasureContext(min_repeat_ms=300)
      measure_runner = auto_scheduler.RPCRunner("m1", "127.0.0.1", 9190, min_repeat_ms=300, timeout=30, repeat=3)
      tune_option = auto_scheduler.TuningOptions(
          num_measure_trials=1500, 
          check_correctness=True,
          builder_n_parallel=1,
          runner=measure_runner,
          measure_callbacks=[auto_scheduler.RecordToFile(log_file)],
          verbose=2,
      )

      sch, args = auto_scheduler.auto_schedule(task, tuning_options=tune_option)

Example 2: Sparse tuning, this will register given buffers for measure.

if train_flag:
      #measure_ctx = auto_scheduler.LocalRPCMeasureContext(min_repeat_ms=300)
      measure_runner = auto_scheduler.RPCRunner("m1", "127.0.0.1", 9190, min_repeat_ms=300, timeout=30, repeat=3)
      tune_option = auto_scheduler.TuningOptions(
          num_measure_trials=1500, 
          #runner=measure_ctx.runner,
          check_correctness=False,
          builder_n_parallel=1,
          runner=measure_runner,
          measure_callbacks=[auto_scheduler.RecordToFile(log_file)],
          verbose=2,
      )
      for k, v in BUFFER.items():
          tune_option.register_buffer(k, v)

cc @merrymercy @FrozenGene

@merrymercy merrymercy self-assigned this Dec 8, 2020
@merrymercy
Copy link
Member

merrymercy commented Dec 8, 2020

I recently refactored the task interface (#7028).
The auto_schedule.py file is deleted. Please rebase.

@antinucleon antinucleon force-pushed the metal branch 2 times, most recently from 7eb402a to f38025d Compare December 9, 2020 04:07
@antinucleon
Copy link
Contributor Author

@FrozenGene @merrymercy Updated.

Copy link
Member

@FrozenGene FrozenGene left a comment

Choose a reason for hiding this comment

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

I think you want to update submodule? So you have change showing you have changed the vta-hw submodule.

@antinucleon
Copy link
Contributor Author

I think you want to update submodule? So you have change showing you have changed the vta-hw submodule.

Updated

check_correctness=False,
verbose=1,
builder="local",
builder_n_parallel=-1,
Copy link
Member

Choose a reason for hiding this comment

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

Seems we still omit here of -1, there is no place to have logic to handle -1 now.

Copy link
Contributor Author

@antinucleon antinucleon Dec 9, 2020

Choose a reason for hiding this comment

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

This file is no longer used according to #7053 (comment) I think @merrymercy forgets to delete it.

Copy link
Member

Choose a reason for hiding this comment

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

Ok.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah. I forget to delete it. Fixed by #7071

@antinucleon antinucleon changed the title [auto_scheduler] buffer support, correctness check [wip][auto_scheduler] buffer support, correctness check Dec 9, 2020
@antinucleon
Copy link
Contributor Author

I find out this solution only work for a single task, but doesn't work with TaskScheduler. Will update it later.

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.

3 participants