-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove flag use_mkldnn_wgt #3548
Changes from 3 commits
0945dc1
e08651f
635b867
07d16e3
fb7d8d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,12 @@ limitations under the License. */ | |
|
||
namespace paddle { | ||
|
||
typedef enum { | ||
PARAM_FORMAT_ORIGINAL = 0, // the paddle original basic format | ||
PARAM_FORMAT_MKLDNN_OI, // the mkldnn format oi | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oi是其中一种mkldnn的格式吧。这里能给个链接么,或者给个详细点的说明。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 好的,done |
||
PARAM_FORMAT_ITEMS, // the total format items numbers | ||
} PARAM_FORMAT; | ||
|
||
class SparsePrefetchRowCpuMatrix; | ||
|
||
class Parameter; | ||
|
@@ -242,14 +248,30 @@ class Parameter { | |
/// Initialize the value to 0 | ||
void zeroMem(); | ||
|
||
static const int kFormatVersion = 0; | ||
/// file header structure | ||
struct Header { | ||
int32_t version; // = 0, file format version | ||
int32_t format; // = PARAM_FORMAT | ||
uint32_t valueSize; // = sizeof(real) | ||
uint64_t size; // = getSize() | ||
}; | ||
|
||
/** | ||
* @brief Is the header supported | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 259行注释不全,文件头支持什么? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, done. |
||
*/ | ||
static bool isHeaderFormatSupported(int32_t fmt) { | ||
return fmt < PARAM_FORMAT_ITEMS; | ||
} | ||
|
||
/** | ||
* @brief Get the format in header | ||
*/ | ||
int getHeaderFormat() { return headerFormat_; } | ||
|
||
/** | ||
* @brief Set the format in header | ||
*/ | ||
void setHeaderFormat(int32_t fmt) { headerFormat_ = fmt; } | ||
|
||
/** | ||
* @brief Parameter Update Hook. | ||
* | ||
|
@@ -321,6 +343,9 @@ class Parameter { | |
bool updated_; | ||
SparseFormat format_; | ||
|
||
// The header format for saving or loading param | ||
int32_t headerFormat_; | ||
|
||
std::vector<std::shared_ptr<IParameterUpdaterHook>> updaterHooks_; | ||
|
||
public: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done