Problems about the autotvm of intel_graphics

the autotvm of intel_grapchis can work, but there are some problems.

  1. it seems that for conv2d it just ran one time even when i set the early_stop to large number
    maybe it related to the tasks create, I tried to defined the task of conv2d with template_key= ‘direct’, but failed
    • for i in range(len(tasks)):
    •             try:  
      
    •                 print("op_nmae %",tasks[i].workload[0])
      
    •                 op_name = tasks[i].workload[0]
      
    •                 func_create = tasks[i].name
      
    •                 if(op_name == 'conv2d'):
      
    •                      func_create = 'topi_intel_graphics_conv2d_NCHWc'
      
    •                 tsk = autotvm.task.create(func_create, args=tasks[i].args,
      
    •                                target=tasks[i].target, tarrget_host=tasks[i].target_host,template_key='direct')
      
    •                 input_channel = tsk.workload[1][1]
      
    •                 if input_channel >= 64:
      
    •                     tasks[i] = tsk
      
    •             except Exception:
      
    •                 print("in the except")
      
    •                 pass
      

op_name % depthwise_conv2d_nchw
[Task 1/48] Current/Best: 15.68/ 15.68 GFLOPS | Progress: (8/8) | 20.07 s Done.
op_name % depthwise_conv2d_nchw
[Task 2/48] Current/Best: 0.89/ 20.60 GFLOPS | Progress: (8/8) | 8.79 s Done.
op_name % conv2d
[Task 3/48] Current/Best: 43.59/ 43.59 GFLOPS | Progress: (1/8) | 1.99 s Done.

  1. after the autotvm of tasks, when doing the build, it failed when with relay.build_config(opt_level=3):
    it failed: KeyError: ‘tile_ic’
    but it can pass if opt_level is set to 2 in the with relay.build_config(opt_level=2)

@Laurawly
Could you help take a look at these problems? thanks a lot!

Can you show all of your code to reproduce it?

It ran for a customed tensorflow network with conv2d and depthwise_conv2d. without the .pb, the result can not be reproduced.

for it failed: keyError: ‘tile_ic’ , is it caused by this : No available config in the history file. the tuning space is just 1 and unfortunately that only one config cannot be built for some reasons ? for op_name % conv2d, it always ran just 1 trial even when the early_stopping set to large number.

Could you try x86 autotvm tutorial by commenting out the graph tune function and see what’s your results?

I tried the x86 autotvm tutorial with following changes: target = ‘opencl -device=intel_graphics’

for i, tsk in enumerate(tasks):
    prefix = "[Task %2d/%2d] " % (i+1, len(tasks))

    # converting conv2d tasks to conv2d_NCHWc tasks
    op_name = tsk.workload[0]
    print('op_name:%', op_name)
    if op_name == 'conv2d':
        #func_create = 'topi_x86_conv2d_NCHWc'
        func_create = 'topi_intel_graphics_conv2d_NCHWc'
    elif op_name == 'depthwise_conv2d_nchw':
        #func_create = 'topi_x86_depthwise_conv2d_NCHWc_from_nchw'
        func_create = 'topi_nn_depthwise_conv2d_nchw'
    else:
        raise ValueError("Tuning {} is not supported on x86".format(op_name))
       

    task = autotvm.task.create(func_create, args=tsk.args,
                               target=target, template_key='direct')
    task.workload = tsk.workload

the result:

op_name:% conv2d
[Task 1/48] Current/Best: 0.00/ 0.00 GFLOPS | Progress: (8/175) | 8.65 s Done.
op_name:% conv2d
[Task 2/48] Current/Best: 0.00/ 0.00 GFLOPS | Progress: (8/420) | 7.92 s Done.
op_name:% conv2d
[Task 3/48] Current/Best: 0.00/ 0.00 GFLOPS | Progress: (16/1560) | 17.58 s Done.
op_name:% depthwise_conv2d_nchw
[Task 4/48] Current/Best: 5.56/ 29.33 GFLOPS | Progress: (32/8601600) | 51.66 s Done.
op_name:% conv2d
[Task 5/48] Current/Best: 0.00/ 0.00 GFLOPS | Progress: (24/840) | 23.97 s Done.
op_name:% conv2d
[Task 6/48] Current/Best: 0.00/ 0.00 GFLOPS | Progress: (16/960) | 17.21 s Done.
op_name:% conv2d
[Task 7/48] Current/Best: 0.00/ 0.00 GFLOPS | Progress: (16/600) | 17.04 s Done.
op_name:% conv2d
[Task 8/48] Current/Best: 0.00/ 0.00 GFLOPS | Progress: (8/800) | 8.59 s Done.

Thank you very much!