Repository navigation
Deprecate legacy hdfs file system - #46955
Conversation
This PR is part of the effort to switch to modular file system support by deprecates hdfs file system and direct user to use modular file system from tensorflow-io instead. A `TF_ENABLE_LEGACY_FILESYSTEM=1` will allow the usage of legacy hdfs file system the same way as before (a warning will be displayed). Signed-off-by: Yong Tang <[email protected]>
| return; | ||
| } | ||
| LOG(WARNING) << "Legacy file system for '" << scheme << "' is deprecated" | ||
| << " and will be removed in tensorflow 2.6 or higher." |
There was a problem hiding this comment.
@yongtang aren't we looking at TensorFlow 2.5 release for the filesystem migration?
cc: @mihaimaruseac
There was a problem hiding this comment.
@kvignesh1420 If the PR can be merged before upcoming 2.5, then hdfs will be deprecated in 2.5 (with the option of using TF_ENABLE_LEGACY_FILESYSTEM=1 to keep in legacy mode), in 2.6 or higher we can consider completely remove hdfs.
There was a problem hiding this comment.
Can we have this env var documented somewhere?
|
@yongtang thanks for the PR. does it mean after tf 2.5 or 2.6, HDFS access from TF is officially supported from tensorflow IO? |
|
@burgerkingeater Yes that is the plan. Refers to SIG IO's monthly meeting notes: |
…t-count mismatch in the HLO parser Imported from GitHub PR openxla/xla#47057 ## 📝 Summary of Changes Validate reshape and dynamic-reshape invariants in `HloParserImpl::CreateInstruction` before calling the `HloInstruction` factories, so malformed HLO text gets a parse error instead of a fatal CHECK. ## 🎯 Justification Fixes #46955. Parsing HLO text where a `reshape` (or `dynamic-reshape`) output shape has a different element count than its operand kills the process: `HloInstruction::CreateReshape` / `CreateDynamicReshape` enforce the invariant with fatal `CHECK`s, and the text parser calls them unguarded. The proto path already guards the exact same invariants with Status-returning `TF_RET_CHECK` in `CreateFromProto`; this change gives the text parser the same treatment, using the parser's `TokenError` so the message carries line/column context. Three cases are covered (the third is not in the issue but is the same hole): - `reshape` with mismatched element count (respecting the factory's unbounded-dynamic operand escape), - `dynamic-reshape` with mismatched element count, - `dynamic-reshape` with the wrong number of dim-size operands. The factory CHECKs themselves are intentionally left alone; every internal caller guarantees the invariant, and weakening them would hide real bugs. Two scope notes. The guards mirror the proto path exactly, which is slightly stricter than the factory CHECK for non-array shapes (e.g. reshaping a token now gets a parse error; it previously parsed and then failed in the verifier, and DCHECK-crashed debug builds). And the same bug class exists for `replica-id`/`partition-id` with an explicit non-`u32[]` shape (their factories CHECK the shape); left out of scope here since #46955 is about reshape, can file a follow-up. ## 🚀 Kind of Contribution 🐛 Bug Fix ## 🧪 Unit Tests: Four tests in `xla/hlo/parser/hlo_parser_test.cc`: three negative (`ParseReshapeElementCountMismatch`, `ParseDynamicReshapeElementCountMismatch`, `ParseDynamicReshapeDimSizeOperandCountMismatch`) that crash the test binary with the issue's exact CHECK signature without the parser change and pass with it, plus `ParseReshapeUnboundedDynamicOperandStillParses` pinning the unbounded-dynamic escape hatch. Full `//xla/hlo/parser:hlo_parser_test` and `//xla/service:hlo_verifier_test` pass. ## 🧪 Execution Tests: None needed; the change is parse-time only (CPU, no accelerator involved). Copybara import of the project: -- a2800f43eeba129c1085f183cb9c575014cdcd2c by Stanislav Bardyuk <[email protected]>: Return a parse error instead of crashing on reshape element-count mismatch The HLO text parser called HloInstruction::CreateReshape and CreateDynamicReshape without validating their preconditions, so malformed input crashed the process on the factories' fatal CHECKs: element-count mismatch between result and operand, and a wrong number of dynamic-reshape dim size operands. The proto path already guards the same invariants with TF_RET_CHECK in CreateFromProto. Validate in the parser and return a line-anchored parse error instead, keeping the factory CHECKs and the unbounded-dynamic operand exemption intact. Fixes #46955. Merging this change closes #47057 FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#47057 from kodlan:fix/issue-46955-parser-reshape-crash a2800f43eeba129c1085f183cb9c575014cdcd2c PiperOrigin-RevId: 963258845
…t-count mismatch in the HLO parser Imported from GitHub PR openxla/xla#47057 ## 📝 Summary of Changes Validate reshape and dynamic-reshape invariants in `HloParserImpl::CreateInstruction` before calling the `HloInstruction` factories, so malformed HLO text gets a parse error instead of a fatal CHECK. ## 🎯 Justification Fixes #46955. Parsing HLO text where a `reshape` (or `dynamic-reshape`) output shape has a different element count than its operand kills the process: `HloInstruction::CreateReshape` / `CreateDynamicReshape` enforce the invariant with fatal `CHECK`s, and the text parser calls them unguarded. The proto path already guards the exact same invariants with Status-returning `TF_RET_CHECK` in `CreateFromProto`; this change gives the text parser the same treatment, using the parser's `TokenError` so the message carries line/column context. Three cases are covered (the third is not in the issue but is the same hole): - `reshape` with mismatched element count (respecting the factory's unbounded-dynamic operand escape), - `dynamic-reshape` with mismatched element count, - `dynamic-reshape` with the wrong number of dim-size operands. The factory CHECKs themselves are intentionally left alone; every internal caller guarantees the invariant, and weakening them would hide real bugs. Two scope notes. The guards mirror the proto path exactly, which is slightly stricter than the factory CHECK for non-array shapes (e.g. reshaping a token now gets a parse error; it previously parsed and then failed in the verifier, and DCHECK-crashed debug builds). And the same bug class exists for `replica-id`/`partition-id` with an explicit non-`u32[]` shape (their factories CHECK the shape); left out of scope here since #46955 is about reshape, can file a follow-up. ## 🚀 Kind of Contribution 🐛 Bug Fix ## 🧪 Unit Tests: Four tests in `xla/hlo/parser/hlo_parser_test.cc`: three negative (`ParseReshapeElementCountMismatch`, `ParseDynamicReshapeElementCountMismatch`, `ParseDynamicReshapeDimSizeOperandCountMismatch`) that crash the test binary with the issue's exact CHECK signature without the parser change and pass with it, plus `ParseReshapeUnboundedDynamicOperandStillParses` pinning the unbounded-dynamic escape hatch. Full `//xla/hlo/parser:hlo_parser_test` and `//xla/service:hlo_verifier_test` pass. ## 🧪 Execution Tests: None needed; the change is parse-time only (CPU, no accelerator involved). Copybara import of the project: -- a2800f43eeba129c1085f183cb9c575014cdcd2c by Stanislav Bardyuk <[email protected]>: Return a parse error instead of crashing on reshape element-count mismatch The HLO text parser called HloInstruction::CreateReshape and CreateDynamicReshape without validating their preconditions, so malformed input crashed the process on the factories' fatal CHECKs: element-count mismatch between result and operand, and a wrong number of dynamic-reshape dim size operands. The proto path already guards the same invariants with TF_RET_CHECK in CreateFromProto. Validate in the parser and return a line-anchored parse error instead, keeping the factory CHECKs and the unbounded-dynamic operand exemption intact. Fixes #46955. Merging this change closes #47057 PiperOrigin-RevId: 963339001
This PR is part of the effort to switch to modular file system support
by deprecates hdfs file system and direct user to use modular file system
from tensorflow-io instead.
A
TF_ENABLE_LEGACY_FILESYSTEM=1will allow the usage of legacy hdfs filesystem the same way as before (a warning will be displayed).
/cc @mihaimaruseac @vnvo2409 @tensorflow/sig-io-maintainers @burgerkingeater
Update: See related changes in tensorflow/io#1309 where hdfs is enabled in tensorflow/io.
Signed-off-by: Yong Tang [email protected]