Skip to content

Commit

Permalink
Fix the linter command in the CI (pytorch#5254)
Browse files Browse the repository at this point in the history
* fix linter command

* ran linter
  • Loading branch information
vanbasten23 committed Jun 27, 2023
1 parent e57b2c1 commit 8ae7f70
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lintercheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
exit 1
fi
find . -name '*.cpp' -o -name '*.h' -name '*.cc' | xargs "${CLANG_FORMAT}" -i -style=file
find . -name '*.cpp' -o -name '*.h' -o -name '*.cc' | xargs "${CLANG_FORMAT}" -i -style=file
git_status=$(git status --porcelain)
if [[ $git_status ]]; then
git diff
Expand Down
7 changes: 3 additions & 4 deletions torch_xla/csrc/ir_dump_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
namespace torch_xla {

enum class EmitMode {
kHloReadable,
kStableHloReadable,
kStableHloBytecode,
kHloReadable,
kStableHloReadable,
kStableHloBytecode,
};


class DumpUtil {
public:
static std::string ToDot(absl::Span<const torch::lazy::Node* const> nodes);
Expand Down
7 changes: 4 additions & 3 deletions torch_xla/csrc/runtime/stablehlo_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ static std::string getMlirModuleBytecode(const mlir::ModuleOp& mlir_module) {
std::string txt_mlir_module;
llvm::raw_string_ostream os{txt_mlir_module};
// TODO(qihqi): pass in version
auto result = mlir::stablehlo::serializePortableArtifact(mlir_module, /* target_version = */"current", os);
auto result = mlir::stablehlo::serializePortableArtifact(
mlir_module, /* target_version = */ "current", os);
XLA_CHECK(result.succeeded()) << "Serializing StableHLO Failed";
return txt_mlir_module;
}
Expand Down Expand Up @@ -77,7 +78,8 @@ static absl::Status mhloToStablehloHelper(mlir::ModuleOp* mlir_module,
;
}

std::string hloToStablehlo(const xla::HloModuleProto* proto, bool emit_bytecode) {
std::string hloToStablehlo(const xla::HloModuleProto* proto,
bool emit_bytecode) {
mlir::MLIRContext context;
mlir::ModuleOp mlir_module =
mlir::ModuleOp::create(mlir::UnknownLoc::get(&context));
Expand All @@ -98,6 +100,5 @@ std::string hloToStablehlo(const xla::HloModuleProto* proto, bool emit_bytecode)
}
}


} // namespace runtime
} // namespace torch_xla
3 changes: 2 additions & 1 deletion torch_xla/csrc/runtime/stablehlo_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
namespace torch_xla {
namespace runtime {

std::string hloToStablehlo(const xla::HloModuleProto* proto, bool emit_bytecode);
std::string hloToStablehlo(const xla::HloModuleProto* proto,
bool emit_bytecode);

} // namespace runtime
} // namespace torch_xla
Expand Down
2 changes: 1 addition & 1 deletion torch_xla/csrc/xla_graph_executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "torch_xla/csrc/debug_util.h"
#include "torch_xla/csrc/device.h"
#include "torch_xla/csrc/ir.h"
#include "torch_xla/csrc/ir_dump_util.h"
#include "torch_xla/csrc/lowering_context.h"
#include "torch_xla/csrc/runtime/async_task.h"
#include "torch_xla/csrc/runtime/cache.h"
Expand All @@ -27,7 +28,6 @@
#include "torch_xla/csrc/tensor.h"
#include "torch_xla/csrc/torch_util.h"
#include "torch_xla/csrc/view.h"
#include "torch_xla/csrc/ir_dump_util.h"

namespace torch_xla {

Expand Down

0 comments on commit 8ae7f70

Please sign in to comment.