-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[relay][pass] Annotation for heterogeneous compilation (#2361)
- Loading branch information
Showing
24 changed files
with
1,494 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/*! | ||
* Copyright (c) 2018 by Contributors | ||
* \file tvm/relay/attrs/annotation.h | ||
* \brief Attribute for annotation operators. | ||
*/ | ||
#ifndef TVM_RELAY_ATTRS_ANNOTATION_H_ | ||
#define TVM_RELAY_ATTRS_ANNOTATION_H_ | ||
|
||
#include <tvm/attrs.h> | ||
#include <string> | ||
|
||
namespace tvm { | ||
namespace relay { | ||
|
||
/*! | ||
* \brief Options for the device annotation operators. | ||
*/ | ||
struct OnDeviceAttrs : public tvm::AttrsNode<OnDeviceAttrs> { | ||
int device_type; | ||
|
||
TVM_DECLARE_ATTRS(OnDeviceAttrs, "relay.attrs.OnDeviceAttrs") { | ||
TVM_ATTR_FIELD(device_type) | ||
.describe( | ||
"The virutal device/context type that an expression is annotated with.") | ||
.set_default(0); | ||
} | ||
}; | ||
|
||
} // namespace relay | ||
} // namespace tvm | ||
#endif // TVM_RELAY_ATTRS_ANNOTATION_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/*! | ||
* Copyright (c) 2018 by Contributors | ||
* \file tvm/relay/attrs/device_copy.h | ||
* \brief Attribute for the device copy operator. | ||
*/ | ||
#ifndef TVM_RELAY_ATTRS_DEVICE_COPY_H_ | ||
#define TVM_RELAY_ATTRS_DEVICE_COPY_H_ | ||
|
||
#include <tvm/attrs.h> | ||
#include <string> | ||
|
||
namespace tvm { | ||
namespace relay { | ||
|
||
/*! | ||
* \brief Options for the device copy operators. | ||
*/ | ||
struct DeviceCopyAttrs : public tvm::AttrsNode<DeviceCopyAttrs> { | ||
int dst_dev_type; | ||
int src_dev_type; | ||
|
||
TVM_DECLARE_ATTRS(DeviceCopyAttrs, "relay.attrs.DeviceCopyAttrs") { | ||
TVM_ATTR_FIELD(src_dev_type) | ||
.describe( | ||
"The virutal device/context type where the op copies data from.") | ||
.set_default(0); | ||
TVM_ATTR_FIELD(dst_dev_type) | ||
.describe( | ||
"The virutal device/context type where the op copies data to.") | ||
.set_default(0); | ||
} | ||
}; | ||
|
||
} // namespace relay | ||
} // namespace tvm | ||
#endif // TVM_RELAY_ATTRS_DEVICE_COPY_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# pylint: disable=wildcard-import, unused-import, unused-wildcard-import | ||
"""Annotation related operators.""" | ||
# Re-export in a specific file name so that autodoc can pick it up | ||
from .op.annotation import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.