apply_vocabulary lookup table initialization needs to be wrapped inside `tf.init_scope`
@varshaan đang làm issue này rồi.
Từ ngày 18/11/2021.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
We recently encountered scalability issues when trying to apply the vocabularies for multiple (5 to be exact) categorical features. We saw multiple lines of the follwoing warning message:
WARNING:tensorflow:Tables initialized inside a tf.function will be re-initialized on every invocation of the function. This re-initialization can have significant impact on performance. Consider lifting them out of the graph context using `tf.init_scope`.
When using the tft.apply_vocabulary, the job would stuck on the transformation steps for hours, consuming thousands of CPU hours if we do not kill it early.
Creating a custom lookup table initialization function like the following could bypass the proble; 80M rows of data only took 35 min, consuming ~20 hours of CPU time.
def create_file_lookup(filename):
with tf.init_scope():
initializer = tf.lookup.TextFileInitializer(
filename,
key_dtype=tf.string,
key_index=tf.lookup.TextFileIndex.WHOLE_LINE,
value_dtype=tf.int64,
value_index=tf.lookup.TextFileIndex.LINE_NUMBER,
value_index_offset=1, # starting from 1
)
table = tf.lookup.StaticHashTable(initializer, 0)
return table
Relevant code need to be addressed:
https://github.com/tensorflow/transform/blob/520ebb492c2f687ff30cce22261938037384b26d/tensorflow_transform/mappers.py#L1114
This probably needs to be applied to versions of TFT starting from 1.0
- Ngôn ngữ chính
- Python
- Star
- 989
- Fork
- 225
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của tensorflow/transform
-
stat:contributions welcome type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
tensorflow/transform#347 ·
-
bug stat:awaiting response
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
tensorflow/transform#339 · 2 bình luận ·
-
examples/README.md has dead link to getting startedCó thể làm lại được @pindinagesh đã nhận 1598 ngày trước và không có pull request nào đang mở. Đang mởstat:contributions welcome type:support
tensorflow/transform#272 · 4 bình luận · 1 người được giao ·
-
scale_to_z_score_per_key should give caller control over OOV behaviorCó thể làm lại được @iindyk đã nhận 1790 ngày trước và không có pull request nào đang mở. Đang mởstat:contributions welcome type:feature
tensorflow/transform#252 · 6 bình luận · 2 người được giao ·
-
Table not initialized when serving modelCó thể làm lại được @varshaan đã nhận 1985 ngày trước và không có pull request nào đang mở. Đang mởEtsy stat:contributions welcome
tensorflow/transform#237 · 11 bình luận · 1 người được giao ·
Tất cả issue của tensorflow/transform
Issue tương tự
-
Layers of type "3D Unknown" and "3D Measured Unknown" are refused, so FileGDB multipatch layers can't be readCó thể đã có người làm @aidannewsome đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
quantization
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
vllm-project/vllm#59904 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
mikf/gallery-dl#9791 ·
-
Speaker custom-fields CSV export returns 404 instead of downloading dataCó thể đã có người làm @techvoyager-varun đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
fossasia/eventyay#6151 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
P4: low tooling
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
jeffknupp/association#318 ·