예제 #1
0
def main(args):
    print("IREE handy-dandy-LLVM-submodule-updater at your service...")
    print(f"  IREE Path: {args.repo}")
    print(f"  LLVM Path: {args.llvm_path}")
    print(f"  LLVM Bazel Path: {args.llvm_bazel_path}")
    print(f"  TensorFlow Path: {args.tensorflow_path}")
    print(f"  MLIR-HLO Path: {args.tensorflow_path}")

    current_llvm_commit = parse_rev(args.llvm_path, "HEAD")
    current_llvm_bazel_commit = parse_rev(args.llvm_bazel_path, "HEAD")
    current_tf_commit = parse_rev(args.tensorflow_path, "HEAD")
    current_mlir_hlo_commit = parse_rev(args.mlir_hlo_path, "HEAD")
    print("Current Commits:")
    print(f"  llvm = {current_llvm_commit}")
    print(f"  llvm_bazel = {current_llvm_bazel_commit}")
    print(f"  tensorflow = {current_tf_commit}")
    print(f"  mlir-hlo = {current_mlir_hlo_commit}")

    # Update LLVM-Bazel
    new_llvm_bazel_commit = find_new_llvm_bazel_commit(args.llvm_bazel_path,
                                                       current_llvm_commit,
                                                       args.llvm_bazel_rev)
    print(f"\n*** Updating LLVM Bazel to {new_llvm_bazel_commit} ***")
    utils.execute(["git", "checkout", new_llvm_bazel_commit],
                  cwd=args.llvm_bazel_path)
    stage_path(args.repo, args.llvm_bazel_path)

    validate_llvm_bazel_commit(current_llvm_commit,
                               args.llvm_bazel_path,
                               exit_on_failure=args.validate)

    # Update TensorFlow
    new_tf_commit = find_new_commit_from_version_file(args.tensorflow_path,
                                                      TF_WORKSPACE_FILEPATH,
                                                      current_llvm_commit,
                                                      args.tensorflow_rev)
    print("\n*** Updating TensorFlow to", new_tf_commit, "***")
    utils.execute(["git", "checkout", new_tf_commit], cwd=args.tensorflow_path)
    stage_path(args.repo, args.tensorflow_path)

    validate_tf_commit(current_llvm_commit,
                       args.tensorflow_path,
                       exit_on_failure=args.validate)

    # Update MLIR-HLO
    new_mlir_hlo_commit = find_new_commit_from_version_file(
        args.mlir_hlo_path, MLIR_HLO_LLVM_VERSION_FILEPATH,
        current_llvm_commit, args.mlir_hlo_rev)
    print("\n*** Updating MLIR-HLO to", new_mlir_hlo_commit, "***")
    utils.execute(["git", "checkout", new_mlir_hlo_commit],
                  cwd=args.mlir_hlo_path)
    stage_path(args.repo, args.mlir_hlo_path)

    validate_mlir_hlo_commit(current_llvm_commit,
                             args.mlir_hlo_path,
                             exit_on_failure=args.validate)

    # Export SUBMODULE_VERSIONS.
    print()  # Add line break.
    submodule_versions.export_versions(args.repo)
예제 #2
0
def main(args):
    print("IREE handy-dandy-LLVM-submodule-updater at your service...")
    print("  IREE Path :", args.repo)
    print("  LLVM Path :", args.llvm)
    print("  TensorFlow Path :", args.tensorflow)
    print("  Update Build files:", args.update_build_files)
    current_llvm_commit = get_commit(args.llvm)
    current_tensorflow_commit = get_commit(args.tensorflow)

    print("Current Commits: llvm =", current_llvm_commit, "tensorflow =",
          current_tensorflow_commit)

    # Update TensorFlow
    new_tf_commit = find_new_tf_commit(args.tensorflow, current_llvm_commit,
                                       args.tensorflow_commit)
    print("\n*** Updating TensorFlow to", new_tf_commit, "***")
    utils.execute(["git", "checkout", new_tf_commit], cwd=args.tensorflow)
    stage_path(args.repo, args.tensorflow)

    validate_tf_commit(current_llvm_commit,
                       args.tensorflow,
                       exit_on_failure=args.validate)

    if args.update_build_files:
        print("\n*** Updating BUILD.bazel files ***")
        update_build_files_from_tensorflow(args.repo, args.tensorflow)

    # Export SUBMODULE_VERSIONS.
    print()  # Add line break.
    submodule_versions.export_versions(args.repo)
예제 #3
0
def main(args):
    print("IREE handy-dandy-LLVM-submodule-updater at your service...")
    print("  IREE Path :", args.repo)
    print("  LLVM Path :", args.llvm)
    print("  TensorFlow Path :", args.tensorflow)
    print("  Update Build files:", args.update_build_files)
    current_llvm_commit = get_commit(args.llvm)
    current_tensorflow_commit = get_commit(args.tensorflow)

    print("Current Commits: llvm =", current_llvm_commit, "tensorflow =",
          current_tensorflow_commit)

    # Update TensorFlow
    if args.tensorflow_commit == "KEEP":
        print("Not updating TensorFlow (--tensorflow_commit == 'KEEP')")
    else:
        print("\n*** Updating TensorFlow to", args.tensorflow_commit, "***")
        update_submodule(args.tensorflow, args.tensorflow_commit)
        stage_path(args.repo, "third_party/tensorflow")

    # Update LLVM.
    if args.llvm_commit == "TENSORFLOW":
        args.llvm_commit = find_tensorflow_llvm_commit(args.tensorflow)
        print("Found TensorFlow's LLVM commit:", args.llvm_commit)
        if args.update_build_files is None:
            print("Will update build files from TensorFlow",
                  "because --update_build_files not specified")
            args.update_build_files = True
    if args.llvm_commit == "KEEP":
        print("Not updating LLVM (--llvm_commit == 'KEEP')")
    else:
        print("\n*** Updating LLVM to", args.llvm_commit, "***")
        update_submodule(args.llvm, args.llvm_commit)
        stage_path(args.repo, "third_party/llvm-project")

    # Update build files.
    if not args.update_build_files:
        print("Not updating build files (--update_build_files not specified)")
    else:
        print("\n*** Updating BUILD.bazel files ***")
        update_build_files_from_tensorflow(args.repo, args.tensorflow)

    # Export SUBMODULE_VERSIONS.
    print()  # Add line break.
    submodule_versions.export_versions(args.repo)