Closed agarwal-ayushi closed 2 years ago
@nellie-wu could you take a look?
@agarwal-ayushi Was the run involving any sparse-opt
input (if so, would you please provide your input) or are we trying to do dense modeling as an initial attempt to reproduce the optimal mapping's performance with timeloop-model
?
@nellie-wu As of now there is no sparse-opt
input provided. I am first trying to attempt the dense-modeling with timeloop-model
. This needs converting the timeloop-mapper
.txt output to the required .yaml format. I have provided my attempt to write a .yaml mapping above for the optimal mapping provided in ref-output/timeloop-mapper.map.txt
: here
@agarwal-ayushi I see. So I think you are missing the bypass
specifications.
By default, timeloop-model
will try to keep all tensors in all storage. For example, in psum_spad
, the default will assume all tensors will be stored, so the tize is: 16 (output) + 16 (weight) + 1 (input) = 33. However, in the actual mapping, we only want to keep the Output
tensor, which is indicated by the brackets next to the storage name in the mapping (e.g., line 29) in the specific txt mapping file you are looking at.
To make sure we bypass correctly, please include the bypass
blocks in your mapping, more specifically, line 8-26 in here.
Ok @nellie-wu. I understand my mistake. So to pass these constraints I was giving the complete timeloop-mapper
constraints from constraints/
folder. But that kept giving me an error saying that the mapping fails the architecture constraints.
For timeloop-model
, I suppose since we are modeling for a particular mapping, we only need to provide the bypassing constraints and not the mapping constraints.
Is this understanding correct?
For completion of this post, I added the below to my .yaml and it worked.
- target: psum_spad
type: bypass
bypass: [Inputs, Weights]
keep: [Outputs]
- target: weights_spad
type: bypass
bypass: [Inputs, Outputs]
keep: [Weights]
- target: ifmap_spad
type: bypass
bypass: [Weights, Outputs]
keep: [Inputs]
- target: DummyBuffer
type: bypass
bypass: [Inputs, Outputs, Weights]
- target: shared_glb
type: bypass
bypass: [Weights]
keep: [Inputs, Outputs]
When using timeloop-model
technically you are providing mapping "directives", not "constraints". The mapping directives need to completely and un-ambiguously describe what is going on in the mapping, you cannot ask timeloop-model
to find one among multiple alternatives. That is why you have to describe all the bypassing directives in addition to all the other factors and permutations. Does that make sense?
@angshuman-parashar Yes. Makes sense now. It makes sense to me now why it kept giving an error when I provided it with the constraints. It also clarifies difference between the timeloop-mapper
and the timeloop-model
.
Thank you for your help. Much appreciated.
@agarwal-ayushi Hi may I know how to get the permutation that can be used in the timeloop-model from the timeloop-mapper.map.txt file?
@FishSeeker timeloop-mapper also emits the optimal mapping as a libconfig .cfg file timeloop-mapper.map.cfg
that can be directly fed back into timeloop-model
. This is a recent update -- previously it would emit a set of constraints that resolve to that same mapping, but those constraints needed to be run with timeloop-mapper
, not timeloop-model
.
At the moment we are unable to emit yaml format, but timeloop (either model or mapper) will happily accept libconfig input as well. We do want to emit yaml in future and deprecate libconfig.
@FishSeeker timeloop-mapper also emits the optimal mapping as a libconfig .cfg file
timeloop-mapper.map.cfg
that can be directly fed back intotimeloop-model
. This is a recent update -- previously it would emit a set of constraints that resolve to that same mapping, but those constraints needed to be run withtimeloop-mapper
, nottimeloop-model
.At the moment we are unable to emit yaml format, but timeloop (either model or mapper) will happily accept libconfig input as well. We do want to emit yaml in future and deprecate libconfig.
Thank you.
I am facing an issue while trying to convert the mapper output map.txt file to .yaml format for the timeloop-model. I am specifically working on the tutorial example:
timeloop-accelergy-exercises/workspace/exercises/2020.ispass/timeloop/06-mapper-convlayer-eyeriss
For the mapping given in
ref-output
:timeloop-mapper.map.txt
: here Motivation for my work: I want to usesparse-opt
in thetimeloop-model
on a particular mapping to study impact of sparsity.timeloop-model
uses map.yaml. Hence, this effort. I wrote a map.yaml file:However when I run:
timeloop-model arch/eyeriss_like.yaml arch/components/*.yaml prob/VGG02_layer5.yaml trial_map.yaml
I get this error: I have been unable to figure out the problem in my mapping. Any help would be great. No other files have been modified.