daphne-eu / daphne

DAPHNE: An Open and Extensible System Infrastructure for Integrated Data Analysis Pipelines
Apache License 2.0
67 stars 62 forks source link

Index type in idxMax; index/size type adaption compiler pass #804

Open corepointer opened 3 months ago

corepointer commented 3 months ago

The operation idxMax (and probably other operations as well) return the data type index. We generally don't use that data type which is an unsigned integer with platform dependent size. So this line of DSL fails because we don't instantiate the element-wise equal operation for index (and we should not start doing so):

  correct_pred = idxMax(probs,0) == idxMax(Y,0);

I worked around it for now by manually casting the outputs of idxMax. But this should not be needed. Instead, the compiler should adapt to a compatible integer type. In an ideal world, this compiler pass would adapt this to the least needed size if dimensions are known and only resort to max size integers otherwise.